예제 #1
0
    public Leaf(SpaceColonizationScriptableObject SCData)
    {
        this.SCData = SCData;

        //find point within mesh
        if (SCData.isConvexMesh)
        {
            this.position = (SelectRandomMeshPoints.GetRandomPointInsideConvex(SCData.leafRefShapeMesh) * SCData.leafRefSpawnSize) + SCData.leafRefOffset;
        }
        else
        {
            this.position = (SelectRandomMeshPoints.GetRandomPointInsideNonConvex(SCData.leafRefShapeMesh, SCData.leafRefOffset) * SCData.leafRefSpawnSize);
        }
    }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     mesh   = GetComponent <MeshFilter>().mesh;
     pts[0] = transform.position + SelectRandomMeshPoints.GetRandomPointOnSurface(mesh);
 }