Exemplo n.º 1
0
    public void SwitchState(string newState)
    {
        UIState state = FindState(newState);

        if (state == null)
        {
            Debug.Log("不能找到,是不是名字出错了");
            return;
        }
        m_StateList[m_StateList.Count - 1].Exit(state);
        state.Enter(m_StateList[m_StateList.Count - 1]);
        m_StateList.RemoveAt(m_StateList.Count - 1);
        m_StateList.Add(state);
    }
Exemplo n.º 2
0
 public void PushState(UIState newState)
 {
     uiStateStack.Peek().Exit();
     uiStateStack.Push(newState);
     newState.Enter();
 }
Exemplo n.º 3
0
 public void SwtichState(UIState newState)
 {
     uiStateStack.Pop().Exit();
     uiStateStack.Push(newState);
     newState.Enter();
 }
Exemplo n.º 4
0
 public void TransitionState(int id)
 {
     currentState.Exit();
     currentState = states[id];
     currentState.Enter();
 }
 public void PushCascadeState(UIState newState)
 {
     uiStateStack.Push(newState);
     newState.Enter();
 }