private void onBeatStarted(Signal signal) { if (gameIsOver) { nextState = new ItemIconGameOverState(itemIcon); return; } BeatStartedSignal beatStartedSignal = (BeatStartedSignal)signal; if (beatStartedSignal.BeatType == BeatType.INTRO) { return; } if (beatStartedSignal.BeatType == BeatType.BOARD_MOVE) { if (itemIcon.currentSlot.Next != null) { nextState = new ItemIconSlideState(itemIcon); } else { nextState = new ItemIconPoolState(itemIcon); } } }
void Update() { if (currentState != currentState.GetNextState()) { currentState.End(); currentState = currentState.GetNextState(); currentState.Start(); } currentState.Update(); }
private void onItemIconClicked(Signal signal) { ItemIconClickedSignal itemIconClickedSignal = (ItemIconClickedSignal)signal; if (itemIconClickedSignal.ItemIcon == itemIcon) { itemIcon.transform.position = ItemIconPool.Inst.transform.position; gotClicked = true; nextState = new ItemIconPoolState(itemIcon); } }
private void onBeatStarted(Signal signal) { if (gameIsOver) { nextState = new ItemIconGameOverState(itemIcon); return; } BeatStartedSignal beatStartedSignal = (BeatStartedSignal)signal; Debug.Assert(beatStartedSignal.BeatType == BeatType.ROBOT_MOVE, "wrong BeatType started while command in Slide state. Slide state expects to end on ROBOT_MOVE beat."); nextState = new ItemIconIdleState(itemIcon); }
public void Activate(ItemIconSlot startSlot) { currentSlot = startSlot; currentState = new ItemIconIdleState(this); currentState.Start(); }
public ItemIconSlideState(ItemIcon itemIcon) : base(itemIcon) { nextState = this; }
public ItemIconPoolState(ItemIcon itemIcon) : base(itemIcon) { nextState = this; }