Example #1
0
    override public void InitState()
    {
        base.InitState();

        {
            State state = new PathfindingIdleState();
            state.Init(this);
            _stateMap[eStateType.IDLE] = state;
        }

        {
            State state = new PathfindingState();
            //State state = new PathfindingImmediateState();
            state.Init(this);
            _stateMap[eStateType.PATHFINDING] = state;
        }

        {
            State state = new PathfindingMoveState();
            state.Init(this);
            _stateMap[eStateType.MOVE] = state;
        }

        _state = _stateMap[eStateType.IDLE];
    }
    public override void InitState()
    {
        base.InitState();

        {
            State state = new PlayerIdleState();
            state.Init(this);
            _stateMap[eStateType.IDLE] = state;
        }
        {
            State state = new PathfindingMoveState();
            state.Init(this);
            _stateMap[eStateType.MOVE] = state;
        }
        {
            State state = new PathfindingState();
            state.Init(this);
            _stateMap[eStateType.PATHFINDING] = state;
        }
        {
            State state = new SelectTargetState();
            state.Init(this);
            _stateMap[eStateType.SELECT_TARGET] = state;
        }

        _state = _stateMap[eStateType.IDLE];
    }