void Start() { axis = (BendAxis)Random.Range(0, System.Enum.GetValues(typeof(BendAxis)).Length - 1); rotate = Random.Range(-90, 90); //print(axis + " | " + rotate); //Generate(); }
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); }