using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class UIManager : MonoBehaviour { List points; List lines; public Transform pointsParent; public Transform linesParent; public GameObject button; public GameObject line; string chosen1 = ""; string chosen2 = ""; public CanvasManager3D CM; enum UIState { none, createLine } UIState state = UIState.none; // Start is called before the first frame update void Start() { points = new List(); lines = new List(); } // Update is called once per frame void Update() { switch (state) { case UIState.none: break; case UIState.createLine: if(!chosen1.Equals("") && !chosen2.Equals("")) { createLine(); } break; } } public void createPoint() { string n = CM.createPoint(); GameObject tmp = Instantiate(button); tmp.transform.SetParent(pointsParent); points.Add(tmp); tmp.transform.localPosition = new Vector3(50 + 40 * (points.Count - 1), 0, 0); tmp.GetComponentInChildren().text = n; tmp.GetComponent