Exemplo n.º 1
0
 public IState GetStateAction(BaseStateType _baseStateType)
 {
     if (dicSystemState.ContainsKey(_baseStateType))
     {
         return dicSystemState[_baseStateType];
     }
     #if UNITY_EDITOR
     Debug.LogWarning("Khong ton tai trang thai ku muon lay");
     #endif
     return null;
 }
Exemplo n.º 2
0
 public void ChangeState(BaseStateType _baseStateType)
 {
     IState state = GetStateAction(_baseStateType);
     if (state != null)
     {
         if(stateCurrent != null)
             stateCurrent.EndState();
         stateCurrent = state;
         stateCurrent.BeginState();
     }
     //Neu khong thay doi duoc trang thai thi trang thai cu van hoat dong
 }
Exemplo n.º 3
0
 public void AddStateAction(BaseStateType _baseStateType, IState _state)
 {
     dicSystemState.Add(_baseStateType, _state);
 }