public void Exit(GameStateBase owner) { if (null != uiCtr) { GameObject.Destroy(uiCtr.gameObject); uiCtr = null; } }
public void Enter(GameStateBase owner) { CursorManager.SetCursor(CursorManager.CursorState.DEFAULT); // GameObject prefab = Resources.Load ("StudyRoomScene")as GameObject; // GameObject go = GameObject.Instantiate (prefab); // uiCtr = go.GetComponent<StudyRoomUI> (); ResourcesManager.Instance.Load("StudyRoomScene", (Object asset) => { GameObject go = GameObject.Instantiate((GameObject)asset); uiCtr = go.GetComponent <StudyRoomUI> (); }); }