Exemplo n.º 1
0
    private void CheckChoiceChange(CardChoiceState newChoice)
    {
        if (newChoice == choice)
        {
            return;
        }

        if (newChoice == CardChoiceState.Left)
        {
            dispatcher.Dispatch(CardEvent.Prepare, newChoice, choice);
            dispatcher.Dispatch(CardEvent.PrepareLeft, newChoice, choice);
        }
        else if (newChoice == CardChoiceState.Right)
        {
            dispatcher.Dispatch(CardEvent.Prepare, newChoice, choice);
            dispatcher.Dispatch(CardEvent.PrepareRight, newChoice, choice);
        }

        if (choice == CardChoiceState.Left)
        {
            dispatcher.Dispatch(CardEvent.ExitPrepare, newChoice, choice);
            dispatcher.Dispatch(CardEvent.ExitPrepareLeft, newChoice, choice);
        }
        else if (choice == CardChoiceState.Right)
        {
            dispatcher.Dispatch(CardEvent.ExitPrepare, newChoice, choice);
            dispatcher.Dispatch(CardEvent.ExitPrepareRight, newChoice, choice);
        }

        choice = newChoice;
    }
Exemplo n.º 2
0
 /// <summary>
 /// Reset the card rectTransform when a new card is dispatched.
 /// </summary>
 private void OnDispatchEnd(params object[] data)
 {
     currentAngle          = 0;
     card.localRotation    = Quaternion.identity;
     currentCardPos        = Vector2.zero;
     card.anchoredPosition = currentCardPos;
     choice = CardChoiceState.None;
 }
Exemplo n.º 3
0
 private void OnExecuteChoice(params object[] data)
 {
     choice = (CardChoiceState)data[0];
 }