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)); }
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)); }