Exemplo n.º 1
0
 public void ChangeState(UIState state)
 {
     //We want to disable what the state is doing before changing to a new state so we get a clean template for the UI
     currentState?.BeforeStateChange();
     currentState = state;
     currentState.DisplayState();
     Debug.Log("Current state: " + currentState.ToString());
 }
Exemplo n.º 2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
     references.AddRange(GetComponents <StateReferences>());
     currentState = new LoginState(this);
     currentState.DisplayState();
 }