Esempio n. 1
0
    void ConfirmPlacement_RPC(int bigID, int smallID, Defines.TURN turn, float time)
    {
        // If not correct turn
        if (GameObject.FindGameObjectWithTag("GUIManager").GetComponent <TurnHandler>().turn != turn)
        {
            return;
        }

        BoardScript      board     = GameObject.Find("Board").GetComponent <BoardScript>();
        BigGridScript    bigGrid   = board.bigGrids[bigID].GetComponent <BigGridScript>();
        GridScript       smallGrid = bigGrid.grids[smallID].GetComponent <GridScript>();
        GUIManagerScript guiScript = GameObject.FindGameObjectWithTag("GUIManager").GetComponent <GUIManagerScript>();

        smallGrid.ConfirmPlacement();
        //guiScript.SetTimer(turn, time);
        guiScript.ResetTimer();

        // Confirms p2 action and ask p2 to execute it.
        if (NetworkManager.IsPlayerOne() && turn == Defines.TURN.P2)
        {
            GetNetworkGameLogic().ConfirmPlacement(bigID, smallID, turn, time);
        }
    }