Exemplo n.º 1
0
 void OnBranchStartPoint(Branch branch)
 {
     Debug.Log("Start");
     var clonePrefab = Resources.Load("Prefabs/Clone");
     int start = branch.GetPoints().IndexOf(branch.GetStartPoint());
     int goal = branch.GetPoints().IndexOf(branch.GetGoalPoint());
     GameObject clone = (GameObject)Instantiate(clonePrefab, branch.GetStartPoint(), Quaternion.identity);
     List<Vector3> points = new List<Vector3>(branch.GetPoints());
     var after = branch.GetPoints().GetRange(goal, branch.GetPoints().Count - goal - 1);
     for (int i = 0; i < after.Count; ++i) {
         points.Add(after[i]);
     }
     clone.GetComponent<LineTracer>().SetTracePoints(points);
 }