コード例 #1
0
ファイル: GameController.cs プロジェクト: yazici/Glitchmatch
    IEnumerator BeginEndSequence()
    {
        Debug.Log("Beginning End Sequence");
        isEndSequence = true;
        WinningPlayerDisplay winText = GameObject.FindGameObjectWithTag("WinTextCanvas").GetComponent <WinningPlayerDisplay> ();

        winText.RpcSetGameOver(isEndSequence);

        yield return(new WaitForSeconds(endSequenceTime));

        RestartGame();
    }
コード例 #2
0
ファイル: GameController.cs プロジェクト: yazici/Glitchmatch
    public void RestartGame()
    {
        // TODO: This should be a bit more thorough than this
        GameObject.FindGameObjectWithTag("CollectableSpawner").GetComponent <CollectableSpawner> ().SpawnCollectables();

        GameObject[] players = GameObject.FindGameObjectsWithTag("Player");

        foreach (GameObject player in players)
        {
            PlayerController pc = player.GetComponent <PlayerController> ();
            pc.Reset();
        }

        timeElapsed   = 0.0f;
        isEndSequence = false;

        WinningPlayerDisplay winText = GameObject.FindGameObjectWithTag("WinTextCanvas").GetComponent <WinningPlayerDisplay> ();

        winText.RpcSetGameOver(isEndSequence);
    }