예제 #1
0
 public void MoveToPlace()
 {
     // StartCoroutine(moveCardsToHand(2));
     if (hasMoverAbility && cards.Count > 0)
     {
         fillUp    = false;
         dontFlip  = false;
         dontSwap  = false;
         movespeed = 1f;
         for (int i = 0; i < playerHandLocations.Count; i++)
         {
             moverAbility.Move(new List <IPokerObject>()
             {
                 cards[i]
             }, new List <Locations>()
             {
                 dealerPosition
             }, new List <Locations>()
             {
                 playerHandLocations[i]
             }, this);
         }
     }
 }
예제 #2
0
    IEnumerator getCards(int numberOfCards)
    {
        for (int i = 0; i < numberOfCards; i++)
        {
            IPokerObject ob = realDeck.GetLast();
            dealercards.Add(ob);
            realDeck.RemoveLast();
            ob.GetPokerObject.transform.SetParent(uicards.parentOfPositions);
        }

        for (int i = 0; i < dealercards.Count; i++)
        {
            if (hasMoverAbility)
            {
                parent.dontFlip     = false;
                parent.isRealPlayer = true;
                parent.fillUp       = true;
                parent.speed        = delayeBetweenMiddleCard.Value;
                moverAbility.Move(new List <IPokerObject>()
                {
                    dealercards[i]
                }, new List <Locations>()
                {
                    uicards.startLocation
                }, new List <Locations>()
                {
                    uicards.endLocationsList[i + 1]
                }, parent);
            }
            if (numberOfCards < 3)
            {
                delayeBetweenMiddleCard.Variable.SetValue(0.1f);
            }
            else
            {
                delayeBetweenMiddleCard.Variable.SetValue(defaultV);
            }
            yield return(new WaitForSeconds(delayeBetweenMiddleCard.Value));
        }
        float t = delayeBetweenMiddleCard * dealercards.Count;

        yield return(new WaitForSeconds(t));

        currentTurn.Variable.SetValue(activePlayers.Value[playerIncrease.Value]);
        shouldPlay.Raise();
    }