ogrew / Unity-ProceduralPrimitives

Procedural builder for some basic primitives in Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity-ProceduralPrimitives

Procedural builder for some basic primitives in Unity

- Sphere
- Box
- Cylinder
- Capsule
- Torus
- Grid(Terrain)
- Polygon(Triangle, Rectangle, Circle etc..)
- Polyhedron

Screenshots

image

Usage

image

        _sphere.Generate(
            radius: 1f,
            level: 4,
            _redMaterial
        );

image

        _box.Generate(
            width: 1f,
            height: 1f,
            depth: 1f,
            segments: 4, 
            _yellowMaterial
        );

image

        _cylinder.Generate(
            radialSegments: 24,
            heightSegments: 24,
            topRadius: 0.5f,
            bottomRadius: 0.5f,
            height: 2f,
            _blueMaterial
        );

image

        _capsule.Generate(
            radius: 0.5f,
            height: 1f,
            lats: 16,
            lons: 32,
            rings: 2,
            _redMaterial
        );

image

        _torus.Generate(
            majorRadius: .5f,
            minorRadius: .25f,
            majorSegment: 24,
            minorSegment: 16,
            _yellowMaterial
        );

image

        _grid.Generate(
            width: 12f,
            height: 6f,
            divX: 12,
            divY: 12,
            _blueMaterial
        );

image

        _polygon.Generate(
            shape: 3,
            size: 2f,
            _redMaterial
        );

image

        _polyhedron.Generate(
            type: SolidType.Icosahedron,
            size: 1f,
            _redMaterial
        );

License

MIT

About

Procedural builder for some basic primitives in Unity

License:MIT License


Languages

Language:C# 100.0%