Exemplo n.º 1
0
    public void ClearAI(eStateType stateType)
    {
        // #1
        //List<int> removeIndex = new List<int>();
        //for(int i = 0;i< ListNextAI.Count; i++)
        //{
        //	if (ListNextAI[i].StateType == stateType)
        //		removeIndex.Add(i);
        //}

        //for(int i = 0; i < removeIndex.Count; i++)
        //{
        //	ListNextAI.RemoveAt(removeIndex[i]);
        //}
        //removeIndex.Clear();

        // #2 Predicate 메서드를 이용한 삭제
        //tempState = stateType;
        //ListNextAI.RemoveAll(RemovePredicate);

        // #3 Lamda식 사용
        // () => {} Lamda
        ListNextAI.RemoveAll(
            (nextAI) => {
            return(nextAI.StateType == stateType);
        }
            );

        //ListNextAI.RemoveAll(
        //	(nextAI) => nextAI.StateType == stateType
        //	);
    }
Exemplo n.º 2
0
 public void DispatchCurrentState(eStateType i_State)
 {
     r_StateController.UpdateState(i_State);
     setProcessingOnStateController(i_State == eStateType.Thinking);
     if (i_State != eStateType.Thinking)
     {
         r_StatusController.UpdateCurrentState(i_State);
     }
 }
Exemplo n.º 3
0
 void ChangeState(eStateType nextState)
 {
     if (null != _state)
     {
         _state.Stop();
     }
     _state = _stateMap[nextState];
     _state.Start();
 }
Exemplo n.º 4
0
    public virtual void InitState()
    {
        ReplaceState(eStateType.IDLE, new IdleState());
        ReplaceState(eStateType.MOVE, new MoveState());
        ReplaceState(eStateType.ATTACK, new AttackState());
        ReplaceState(eStateType.DAMAGE, new DamageState());
        ReplaceState(eStateType.DEAD, new DeadState());

        _curState     = _stateMap[eStateType.IDLE];
        _curStateType = eStateType.IDLE;
    }
Exemplo n.º 5
0
    public void ChangeState(eStateType nextState)
    {
        if (null != _curState)
        {
            _curState.Stop();
        }

        _curState = _stateMap[nextState];
        _curState.Start();
        _curStateType = nextState;
    }
Exemplo n.º 6
0
    public void ReplaceState(eStateType changeType, State replaceState)
    {
        if (_stateMap.ContainsKey(changeType))
        {
            _stateMap.Remove(changeType);
        }

        State state = replaceState;

        state.Init(this);
        _stateMap[changeType] = state;
    }
Exemplo n.º 7
0
    public virtual void AddNextAI(eStateType nextStateType,
                                  BaseObject targetObject = null,
                                  Vector3 position        = new Vector3())
    {
        NextAI nextAI = new NextAI();

        nextAI.StateType    = nextStateType;
        nextAI.TargetObject = targetObject;
        nextAI.Position     = position;

        ListNextAI.Add(nextAI);
    }
Exemplo n.º 8
0
 protected virtual void processSpecial()
 {
     CurrentAIState = eStateType.STATE_SPECIAL;
     ChangeAnimation();
 }
Exemplo n.º 9
0
 protected virtual void processDie()
 {
     CurrentAIState = eStateType.STATE_DEAD;
     ChangeAnimation();
 }
Exemplo n.º 10
0
 protected virtual void ProcessAttack()
 {
     Target.ThrowEvent(ConstValue.EventKey_SelectSkill, 0);
     CurrentAIState = eStateType.STATE_ATTACK;
     ChangeAnimation();
 }
Exemplo n.º 11
0
 protected virtual void ProcessMove()
 {
     CurrentAIState = eStateType.STATE_WALK;
     ChangeAnimation();
 }
Exemplo n.º 12
0
 protected virtual void ProcessIdle()
 {
     CurrentAIState = eStateType.STATE_IDLE;
     ChangeAnimation();
 }
Exemplo n.º 13
0
 public void UpdateCurrentState(eStateType i_TurnState)
 {
     r_StatusView.UpdateCurrentColor(m_StateToColorMap[i_TurnState]);
 }
Exemplo n.º 14
0
    public override void SetData(string strKey, params object[] datas)
    {
        if (strKey.Equals(ConstValue.SetData_Status))
        {
            eStateType CurStateType = (eStateType)datas[0];
            StatusSprite.GetComponent <UISprite>().spriteName = "rpg icons"; //아래 스프라이트를 저장한 아틀라스 소환.

            BaseObject SelfType = null;                                      //적의 종류.

            if (CurStateType == eStateType.STATE_ATTACK)
            {
                SelfType = (BaseObject)datas[1];

                if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_1")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_SwordSprite;
                    StatusLabel.text = "공격";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_2")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_BowSprite;
                    StatusLabel.text = "공격";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_3")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_AxeSprite;
                    StatusLabel.text = "공격";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_MINI_BOSS")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_BowSprite;
                    StatusLabel.text = "공격";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_BOSS")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_BowSprite;
                    StatusLabel.text = "공격";
                }
            }

            else if (CurStateType == eStateType.STATE_SPECIAL)
            {
                SelfType = (BaseObject)datas[1];


                if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_1")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_ShieldSprite;
                    StatusLabel.text = "방어";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_2")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_AvoidSprite;
                    StatusLabel.text = "회피";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_3")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_LeapSprite;
                    StatusLabel.text = "도약";
                }
                //재인이형 부탁해요
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_BOSS" &&
                         SelfType.GetComponent <NonPlayer>().AI.IS_SECOND_SKILL == false)
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_ShieldSprite;
                    StatusLabel.text = "화염발사";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_BOSS" &&
                         SelfType.GetComponent <NonPlayer>().AI.IS_SECOND_SKILL == true)
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_ShieldSprite;
                    StatusLabel.text = "알낳기";
                }
                else if (SelfType.GetComponent <NonPlayer>().TEMPLATE_KEY == "ENEMY_MINI_BOSS")
                {
                    StatusSprite.GetComponent <UISprite>().spriteName = ConstValue.GetData_ShieldSprite;
                    StatusLabel.text = "화염발사";
                }
            }
            else
            {
                StatusLabel.text = "";
            }
        }
    }
Exemplo n.º 15
0
 public void UpdateState(eStateType i_State)
 {
     r_StateView.updateStatusMessageWith(r_MessagesMap[i_State]);
 }
Exemplo n.º 16
0
 public void NextState(eStateType state)
 {
     _nextState = state;
 }
Exemplo n.º 17
0
 public void DispatchCurrentState(eStateType i_State)
 {
 }
Exemplo n.º 18
0
 public virtual void Start()
 {
     _nextState = eStateType.NONE;
 }
Exemplo n.º 19
0
 public void NextState(eStateType nextState)
 {
     _nextState = nextState;
 }