Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 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>();
 }
Ejemplo n.º 2
0
    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();
    }
Ejemplo n.º 3
0
    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();
    }
Ejemplo n.º 4
0
    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();
    }
Ejemplo n.º 5
0
    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();
    }