public void OnPointerClick(PointerEventData eventData) { Destroy(GetComponentInParent <Window>().gameObject); PrefabManager pm = FindObjectOfType <PrefabManager>(); WindowSystem ws = FindObjectOfType <WindowSystem>(); FlightPlanEditor editor = Instantiate(pm.prefabFlightPlanEditorView); Window w = ws.NewWindow("FlightPlanEditor", editor.gameObject); w.SetWidth(1200); w.SetHeight(700); editor.SetPlan(_plan); w.Title = "Flight plan editor"; w.Show(); }
private void Start() { createNewButton.onClick.AddListener(() => { Destroy(GetComponentInParent <Window>().gameObject); PrefabManager pm = FindObjectOfType <PrefabManager>(); WindowSystem ws = FindObjectOfType <WindowSystem>(); FlightPlanEditor editor = Instantiate(pm.prefabFlightPlanEditorView); Window w = ws.NewWindow("FlightPlanEditor", editor.gameObject); w.SetWidth(1200); w.SetHeight(700); w.Title = "Flight plan editor"; w.Show(); }); LocalDataManager.instance.OnCorporationChange += OnCorporationChange; }