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(); }
//bet amount public void Bet(int amount) { //Debug.Log("Betting"); //remove amount from cash and add it to total bet cash -= amount; //add it to the current bet currentBetTotal += amount; lastBet.Variable.SetValue(amount); totalBet.Variable.ApplyChange(amount); // playerIncrease.Value += 1; //create chip that would be displayed GameObject go = Instantiate(chipObject.Value, transform.position, Quaternion.identity, chipparent.transform); Chip chip = go.GetComponent <Chip>(); chip.parent = chipparent; go.transform.SetParent(chip.parent.PokerObject); //set the amount of the ship chip.SetAmount(amount); IPokerObject po = chip as IPokerObject; //move chip to the place set in the center if (hasMoverAbility) { moverAbility.Move(new List <IPokerObject>() { po }, new List <Locations>() { chipparent.startLocation }, new List <Locations>() { chipparent.endLocationsList[playerID + 1] }, chip.parent); } UpdateTextDisplay(); }