Procedural builder for some basic primitives in Unity
- Sphere
- Box
- Cylinder
- Capsule
- Torus
- Grid(Terrain)
- Polygon(Triangle, Rectangle, Circle etc..)
- Polyhedron
_sphere.Generate(
radius: 1f,
level: 4,
_redMaterial
);
_box.Generate(
width: 1f,
height: 1f,
depth: 1f,
segments: 4,
_yellowMaterial
);
_cylinder.Generate(
radialSegments: 24,
heightSegments: 24,
topRadius: 0.5f,
bottomRadius: 0.5f,
height: 2f,
_blueMaterial
);
_capsule.Generate(
radius: 0.5f,
height: 1f,
lats: 16,
lons: 32,
rings: 2,
_redMaterial
);
_torus.Generate(
majorRadius: .5f,
minorRadius: .25f,
majorSegment: 24,
minorSegment: 16,
_yellowMaterial
);
_grid.Generate(
width: 12f,
height: 6f,
divX: 12,
divY: 12,
_blueMaterial
);
_polygon.Generate(
shape: 3,
size: 2f,
_redMaterial
);
_polyhedron.Generate(
type: SolidType.Icosahedron,
size: 1f,
_redMaterial
);
MIT