public void SetPath(NextPath path) { Vector3 pos = new Vector3(); pos = GetPosition(path); // SetIndex (); NewPath = Paths[(int)Random.Range(0.1f, 1.9f)]; NewPath = Instantiate(NewPath); NewPath.transform.position = pos; StartCoroutine(Coroutine()); }
//public void SetIndex() //{ // CurrentIndex++; // if (CurrentIndex == Paths.Length) // { // CurrentIndex = 0; // } //} public Vector3 GetPosition(NextPath path) { return(path.pivot.transform.position); }