Ejemplo n.º 1
0
    void GameStart()
    {
        bool ladyFirst   = (Random.Range(-1, 1) >= 0.0);
        int  maleIndex   = ladyFirst ? 1 : 0;
        int  femaleIndex = ladyFirst ? 0 : 1;

        gameView = GameObject.FindGameObjectWithTag("GameView").GetComponent <GameViewController>();
        var players = GameObject.FindGameObjectsWithTag("Player");

        malePlayer   = players[maleIndex].GetComponent <PlayerController>();
        femalePlayer = players[femaleIndex].GetComponent <PlayerController>();

        gameView.Rpc_OnGameStart();
        malePlayer.OnGameStart(true);
        femalePlayer.OnGameStart(false);

        StartCoroutine(DelayFirstStart());
    }