UnityMesh is a Unity C# library for generating procedural meshes at runtime. It provides reusable components for creating and manipulating quad and cube meshes, making it easy to build custom 3D geometry in your Unity projects.
- Unity Engine (C#)
- Procedural mesh generation
- Custom MonoBehaviour components
QuadMesh.cs
: A MonoBehaviour for generating a quad (rectangle) mesh. It exposes width, height, and material properties, and generates vertices, triangles, normals, and UVs for a 2D quad in the X-Y plane.CubeMesh.cs
: A MonoBehaviour for generating a cube mesh. It exposes width, height, breadth, and material properties, and generates all vertices, triangles, normals, and UVs for a 3D cube.
Both components are designed to be attached to GameObjects with a MeshFilter and Renderer. Mesh data is updated every frame, allowing for dynamic mesh manipulation.
- Unity 2021.3 LTS or newer (any recent Unity version should work)
- .NET Framework 4.x (default for Unity projects)
- Copy the contents of the
src/
directory into your Unity project'sAssets/
folder. - Attach the
QuadMesh
orCubeMesh
component to a GameObject with a MeshFilter and Renderer. - Assign a material in the Inspector and set the desired dimensions.
This project is licensed under the MIT License. See LICENCE.md for details.
Participation in this project is governed by the Code of Conduct.
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
If you discover a security vulnerability, please see SECURITY.md for reporting instructions.
For questions or support, please open an issue in the repository.
Project maintained by Joaquin Telleria. For inquiries, please use the issue tracker.
- Unity Technologies for the Unity Engine
- Open source contributors