private void Create_Node_List() { //Node_List = new List<Master_Node>(); //foreach (var pos in Origin_Pos) //{ // Master_Node node = new Master_Node(); // Node_List.Add(node.Set_Node(pos, img)); //} for (int i = 0; i < Node_List.Count; i++) { if (i == 0) { //Node_List[i].Set_Sub_N(); } else { //Node_List[i].Set_Sub_P(); //Node_List[i - 1].Set_Sub_N(); Node_List[i - 1].Set_Next_Node(Node_List[i]); } if (i == Node_List.Count - 1) { //Node_List[0].Set_Sub_P(); //Node_List[i].Set_Sub_N(); Node_List[i].Set_Next_Node(Node_List[0]); } } creator._Path = null; creator.UpdateRoad(); SectionDivide(); }
void OnSceneGUI() { if (creator.autoUpdate && Event.current.type == EventType.Repaint) { creator.UpdateRoad(); } }
public IEnumerator GenerateNextPoint() { while (true) { //Debug.Log("Generate Point!"); generationX += forwardDistanceBetweenPoints; float generationY = Random.Range(-curviness, curviness); Instantiate(roadLight, new Vector3(generationX, generationY, roadLightHeight), Quaternion.identity); // Add new Point curvePath.AddSegment(new Vector2(generationX, generationY)); // Remove Oldest Point Every if (Mathf.FloorToInt(Time.time) % Mathf.FloorToInt(6 * timeBetweenPointGeneration) == 0) { //curvePath.DeleteSegment(0); } roadCreator.UpdateRoad(); yield return(new WaitForSeconds(timeBetweenPointGeneration)); } }
private void OnSceneGUI() { if (_roadCreator.autoUpdate && Event.current.type == EventType.Repaint) { _roadCreator.UpdateRoad(); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); autoUpdate = GUILayout.Toggle(autoUpdate, "Auto Update"); if (Event.current.type == EventType.Repaint && autoUpdate) { creator.UpdateRoad(); } }