コード例 #1
0
ファイル: PassengerSM.cs プロジェクト: Xakkar/zerotram
 void Awake()
 {
     ActiveBonuses = new List<GameController.BonusTypes>();
     PassengerIdleState idleState = new PassengerIdleState(this);
     PassengerMoveState moveState = new PassengerMoveState(this);
     PassengerAttackState attackState = new PassengerAttackState(this);
     PassengerAttackedState attackedState = new PassengerAttackedState(this);
     PassengerStickState stickState = new PassengerStickState(this);
     PassengerFlyingAwayState flyingAwayState = new PassengerFlyingAwayState(this);
     PassengerDraggedState draggedState = new PassengerDraggedState(this);
     FrozenState frozenState = new FrozenState(this);
     PassengerSitState sitState = new PassengerSitState(this);
     Dictionary<int, State> stateMap = new Dictionary<int, State>
     {
         {(int) MovableCharacterStates.Idle, idleState},
         {(int) MovableCharacterStates.Move, moveState},
         {(int) MovableCharacterStates.Attack, attackState},
         {(int) MovableCharacterStates.Attacked, attackedState},
         {(int) MovableCharacterStates.Stick, stickState},
         {(int) MovableCharacterStates.FlyingAway, flyingAwayState},
         {(int) MovableCharacterStates.Dragged, draggedState},
         {(int) MovableCharacterStates.Frozen, frozenState},
         {(int) MovableCharacterStates.Sit, sitState},
     };
     InitWithStates(stateMap, (int)MovableCharacterStates.Idle);
 }
コード例 #2
0
ファイル: PassengerSM.cs プロジェクト: Syjgin/zerotram
    void Awake()
    {
        ActiveBonuses = new List <GameController.BonusTypes>();
        PassengerIdleState       idleState       = new PassengerIdleState(this);
        PassengerMoveState       moveState       = new PassengerMoveState(this);
        PassengerAttackState     attackState     = new PassengerAttackState(this);
        PassengerAttackedState   attackedState   = new PassengerAttackedState(this);
        PassengerStickState      stickState      = new PassengerStickState(this);
        PassengerFlyingAwayState flyingAwayState = new PassengerFlyingAwayState(this);
        PassengerDraggedState    draggedState    = new PassengerDraggedState(this);
        FrozenState             frozenState      = new FrozenState(this);
        PassengerSitState       sitState         = new PassengerSitState(this);
        PassengerHuntState      huntState        = new PassengerHuntState(this);
        PassengerEscapeState    escapeState      = new PassengerEscapeState(this);
        Dictionary <int, State> stateMap         = new Dictionary <int, State>
        {
            { (int)MovableCharacterStates.Idle, idleState },
            { (int)MovableCharacterStates.Move, moveState },
            { (int)MovableCharacterStates.Attack, attackState },
            { (int)MovableCharacterStates.Attacked, attackedState },
            { (int)MovableCharacterStates.Stick, stickState },
            { (int)MovableCharacterStates.FlyingAway, flyingAwayState },
            { (int)MovableCharacterStates.Dragged, draggedState },
            { (int)MovableCharacterStates.Frozen, frozenState },
            { (int)MovableCharacterStates.Sit, sitState },
            { (int)MovableCharacterStates.Hunt, huntState },
            { (int)MovableCharacterStates.Escape, escapeState },
        };

        InitWithStates(stateMap, (int)MovableCharacterStates.Idle);
    }