Пример #1
0
    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);
            }
        }
    }
Пример #2
0
 void Update()
 {
     if (currentState != currentState.GetNextState())
     {
         currentState.End();
         currentState = currentState.GetNextState();
         currentState.Start();
     }
     currentState.Update();
 }
Пример #3
0
    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);
        }
    }
Пример #4
0
    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);
    }
Пример #5
0
 public void Activate(ItemIconSlot startSlot)
 {
     currentSlot  = startSlot;
     currentState = new ItemIconIdleState(this);
     currentState.Start();
 }
Пример #6
0
 public ItemIconSlideState(ItemIcon itemIcon) : base(itemIcon)
 {
     nextState = this;
 }
Пример #7
0
 public ItemIconPoolState(ItemIcon itemIcon) : base(itemIcon)
 {
     nextState = this;
 }