public void MoveNext(GamePhase type) { if (currentState != null) { Debug.Log("MoveNext first state " + currentState.ToString()); currentState.OnExit(); } if (type != GamePhase.ResumeGame) { try { String commentary = "State manager go to the state " + type.ToString(); } catch (Exception e) { Debug.Log(e.Message); } GameManager.instance.SetCurrentState(type); Visual.instance.DisableVisualElementsOnStateEnter(); GameLogicEvents.CopyGameActorsToCurrentGame(); SaveLoadHelper.Save(SaveLoadHelper.defaultPrefixString); GameManager.instance.RemoveStateComponentsFromActor(); Visual.instance.UpdateCounters(); } currentState = dictionary[type]; Visual.instance.disableInput(false); currentState.OnEnter(); }
private void InitializeManager() { MainCamera = GameObject.Find("Main Camera").GetComponent <Camera>(); UICamera = GameObject.Find("UIcamera").GetComponent <Camera>(); Const.CalculateSize(); GameLogicEvents.SubscribeEvents(); CardManager.Instance().Init(); ScreenManager.instance.Show(ScreenManager.ScreenType.Mainmenu); }