예제 #1
0
 void Start()
 {
     axis   = (BendAxis)Random.Range(0, System.Enum.GetValues(typeof(BendAxis)).Length - 1);
     rotate = Random.Range(-90, 90);
     //print(axis + " | " + rotate);
     //Generate();
 }
예제 #2
0
    public void Generate()
    {
        axis   = (BendAxis)Random.Range(0, System.Enum.GetValues(typeof(BendAxis)).Length - 1);
        rotate = Random.Range(-20, 20);

        mesh = GetComponent <MeshFilter>().mesh = new Mesh();
        mesh.Clear();

        SetVertices();
        SetUVs();
        SetTriangles();
        UpdateMesh();

        BendMesh();
        print(axis + " | " + rotate);
    }