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 ("CleanScene")as GameObject; // GameObject go = GameObject.Instantiate (prefab); // uiCtr = go.GetComponent<CleanUI> (); // uiCtr.Init (GameData.HasStomach); ResourcesManager.Instance.Load("CleanScene", (Object asset) => { GameObject go = GameObject.Instantiate((GameObject)asset); uiCtr = go.GetComponent <CleanUI> (); uiCtr.Init(GameData.HasStomach); }); }