Exemple #1
0
    virtual protected void InitState()
    {
        State moveState   = new MoveState();
        State attackState = new AttackState();
        State hitState    = new HitState();


        State skillOneState   = new SkillOne();
        State skillTwoState   = new SkillTwo();
        State skillThreeState = new SkillThree();
        State idleState       = new IdleState();



        moveState.Init(this);
        attackState.Init(this);
        hitState.Init(this);
        skillOneState.Init(this);
        skillTwoState.Init(this);
        skillThreeState.Init(this);
        idleState.Init(this);


        _stateDic.Add(eSTATE.MOVE, moveState);
        _stateDic.Add(eSTATE.ATTACK, attackState);
        _stateDic.Add(eSTATE.HIT, hitState);
        _stateDic.Add(eSTATE.SKILLONE, skillOneState);
        _stateDic.Add(eSTATE.SKILLTWO, skillTwoState);
        _stateDic.Add(eSTATE.SKILLTHREE, skillThreeState);
        _stateDic.Add(eSTATE.IDLE, idleState);
    }
Exemple #2
0
    override protected void InitState()
    {
        base.InitState();



        State attackState = new PlayerAttackState();

        attackState.Init(this);
        _stateDic[eSTATE.ATTACK] = attackState;

        State moveState = new MoveState();

        moveState.Init(this);
        _stateDic[eSTATE.MOVE] = moveState;

        State hitState = new PlayerHitState();

        hitState.Init(this);
        _stateDic[eSTATE.HIT] = hitState;

        State skillOneState = new SkillOne();

        skillOneState.Init(this);
        _stateDic[eSTATE.HIT] = skillOneState;


        State skillTwoState = new SkillTwo();

        skillTwoState.Init(this);
        _stateDic[eSTATE.HIT] = skillTwoState;

        State skillThreeState = new SkillThree();

        skillThreeState.Init(this);
        _stateDic[eSTATE.HIT] = skillThreeState;

        State idleState = new PlayerIdleState();

        idleState.Init(this);
        _stateDic[eSTATE.IDLE] = idleState;
    }