public void StartPorts()
 {
     for (int count = 0; count < 10; count++)
     {
         syncListPortObjectReceiver.Insert(count, 0);
         syncListPortObjectTransmitter.Insert(count, 0);
     }
 }
Esempio n. 2
0
 void Start()
 {
     if (isServer)
     {
         for (int i = 0; i < nbOfIntButtons; i++)
         {
             CalibrInts.Insert(i, 0);
         }
     }
 }
Esempio n. 3
0
    private void BeginGame()
    {
        int        index;
        GameObject aux;

        Initialize();
        RpcInitialize();

        RpcSetEmojisButtonEnabled();
        RpcEliminateNotPossibleCube();

        for (int i = 0; i < 54; i++)
        {
            cardsSpawned[i] = Instantiate(cards[i], transform.position, cards[i].transform.rotation);
            NetworkServer.Spawn(cardsSpawned[i]);
        }

        for (int i = 0; i < 54; i++)
        {
            index               = UnityEngine.Random.Range(0, 54);
            aux                 = cardsSpawned[i];
            cardsSpawned[i]     = cardsSpawned[index];
            cardsSpawned[index] = aux;
        }
        for (int i = 0; i < 54; i++)
        {
            RpcAddCard(cardsSpawned[i]);
        }

        numPlayers = GameObject.FindGameObjectsWithTag("Player").Length;

        numCardsForPlayer = 54 / numPlayers;
        playerTurn        = UnityEngine.Random.Range(0, numPlayers);

        lastGame.Insert(0, -1);
        lastGame.Insert(1, -1);

        position = 1;

        RpcSendNameOfPlayers(Player_control.getplayersName());

        if (!startedGame)
        {
            RpcSetPuntuationTo0(Player_control.getplayersName());
        }

        RpcDealCards(numCardsForPlayer, numPlayers);

        RpcChangePlayerTurn(playerTurn, playersHaveFinished);

        RpcRefreshButtonsInteraction(playerTurn);

        timeNumber = remainingTime;
        RpcSetTime(timeNumber);
        StartCoroutine(ReduceTime(throwNumber));
    }