public UIPlayer(GameTable gameTable, MonoPlayer player) : base(gameTable) { unityPlayer = player; biddingPopup = GameObject.FindGameObjectWithTag("MENUS").transform.FindChild("BiddingPopup").GetComponent <BiddingPopup>(); uiDeck = GameObject.FindGameObjectWithTag("DECK").GetComponent <UIDeck>(); }
public static void PlayCard(Card card, int playedBy, RemoteNetworkPlayer networkPlayer) { destinationPosition = Cards[playedCardCount].position; destinationRotation = Cards[playedCardCount].rotation; GameObject newCardObject = Instantiate(cardPrefab, playerPositions[playedBy].position, cardPrefab.transform.rotation) as GameObject; newCardObject.transform.parent = playedCardsTransform; UICard cardScript = newCardObject.transform.GetComponent <UICard>(); newCardObject.transform.GetComponent <SpriteRenderer>().sortingOrder = 8; cardScript.BindCard(card); Cards[playedCardCount] = newCardObject.transform; playedCardCount++; cardToPlay = card; cardPlayer2 = networkPlayer; moveCard2 = true; UIDeck deck = GameObject.FindGameObjectWithTag("DECK").GetComponent <UIDeck>(); deck.playedCard = cardScript; SoundManagerInstance.PlayCardPlaySound(); }
public void InitializeSinglePlayerGame() { ResetPlayers(); // DUMMY CONDITIONS object[] endingConditionParams = new object[2]; endingConditionParams[0] = gameTable; endingConditionParams[1] = (object)5; gameTable.ChangeGameMode(Common.Enums.GameMode.RoundCount, endingConditionParams); UIDeck.Show(); player.InitializePlayer(gameTable); UIComputer player2 = computer1.InitializeComputer(); UIComputer player3 = computer2.InitializeComputer(); UIComputer player4 = computer3.InitializeComputer(); AddPlayer(player.getInternalPlayer()); AddPlayer(player2); AddPlayer(player3); AddPlayer(player4); gameTable.InitializeGame(); }
public void InitializeMultiPlayerGame(Common.Enums.GameMode gameMode, object endingCondition) { object[] endingConditionParams = new object[2]; endingConditionParams[0] = gameTable; endingConditionParams[1] = endingCondition; gameTable.ChangeGameMode(gameMode, endingConditionParams); UIDeck.Show(); gameTable.InitializeGame(); }
public void InitializeSinglePlayerGame(Common.Enums.GameMode gameMode, object endingCondition) { ResetPlayers(); object[] endingConditionParams = new object[2]; endingConditionParams[0] = gameTable; endingConditionParams[1] = endingCondition; gameTable.ChangeGameMode(gameMode, endingConditionParams); UIDeck.Show(); player.InitializePlayer(gameTable); UIComputer player2 = computer1.InitializeComputer(); UIComputer player3 = computer2.InitializeComputer(); UIComputer player4 = computer3.InitializeComputer(); AddPlayer(player.getInternalPlayer()); AddPlayer(player2); AddPlayer(player3); AddPlayer(player4); gameTable.InitializeGame(); }