Exemplo n.º 1
0
    public bool LocalEndTurn()
    {
        if (localPlayer == null)
        {
            Debug.LogError("Networked game manager doesn't have reference to local player.");
            return(false);
        }

        if (!IsOurTurn())
        {
            Debug.LogError("Can't end local players turn when its not local players turn.");
            return(false);
        }

        //if on server, do server side turn code directly
        if (isServer)
        {
            ServerSideEndTurn();
        }
        //if not on the server, send command to end turn
        else
        {
            clientRequests.CmdRequestTurnEnd();
        }

        return(true);
    }