Esempio n. 1
0
        void Awake()
        {
            Input.gyro.enabled = true;
            stateMachine       = new StateMachine <ShakeKey>();
            stateCache         = new StateCache <ShakeKey>();
            stateCache.CacheState(new ShakeState_Standby(info));
            stateCache.CacheState(new ShakeState_Wait(info));
            stateCache.CacheState(new ShakeState_Shaking(info));
            stateCache.CacheState(new ShakeState_End(info));
            info.stateCache = stateCache;

            stateMachine.SetState(stateCache.GetState(ShakeKey.Standby));
        }
Esempio n. 2
0
        public ShakeCounter(BattleManager manager)
        {
            Input.gyro.enabled = true;
            info         = new ShakeInfo();
            stateMachine = new StateMachine <ShakeKey>();
            stateCache   = new StateCache <ShakeKey>();
            stateCache.CacheState(new ShakeState_Standby(manager, info));
            stateCache.CacheState(new ShakeState_Wait(manager, info));
            stateCache.CacheState(new ShakeState_Shaking(manager, info));
            stateCache.CacheState(new ShakeState_End(manager, info));
            info.stateCache = stateCache;

            stateMachine.SetState(stateCache.GetState(ShakeKey.Standby));
        }