Example #1
0
    IEnumerator PlayerSticksCardIncorrectRoutine(PlayerModule player1, PlayerModule player2, CardSlot cardSlot, CardData card)
    {
        isBusy = true;

        yield return(0);

        cardSlot.Card.SetInfo(card);
        cardSlot.Card.Align(DumpPile.TopCard.transform, player1);

        AudioControl.Instance.PlayInPosition("fp_deal_cards_justwhoosh", cardSlot.transform.position);

        while (cardSlot.Card.isLerping)
        {
            yield return(0);
        }

        AudioControl.Instance.PlayInPosition("fp_lose_bet", cardSlot.transform.position);

        yield return(0);

        cardSlot.Card.Align(cardSlot.transform, player1);

        RegisterAction(() => { StartCoroutine(GiveEmptyCard(player1.GetNextEmptySlot())); });

        GameObject particlesObj = ResourcesLoader.Instance.GetRecycledObject("BadParticles");

        particlesObj.transform.position = DumpPile.transform.position;
        cardSlot.Card.BlinkRed(3);

        yield return(new WaitForSeconds(1f));

        while (cardSlot.Card.isLerping)
        {
            yield return(0);
        }

        yield return(0);

        CurrentSticker = "";

        isBusy = false;
    }