Пример #1
0
    // Switch to game play after countdown finished
    public void CountdownFinished()
    {
        GameController gc = GameObjectFinder.FindGameController();

        gc.LoadedFromFile = LoadedFromFile;
        if (PhotonNetwork.isMasterClient)
        {
            PhotonNetwork.LoadLevel("scenes/gameplay");
        }
    }
Пример #2
0
    // Update number of kills and handle game state if game ends
    public void Killed()
    {
        NumKilled++;
        GameController gc = GameObjectFinder.FindGameController();

        if (GameController.CheckIfGameEnds())
        {
            UpdateProfile(true);
            gc.DisplayGameOverMessage();
        }
    }
Пример #3
0
    private void OnDeath()
    {
        if (IsDead)
        {
            return;
        }
        IsDead = true;
        NumDeath++;
        GameController gc = GameObjectFinder.FindGameController();

        // Update the profile is game ends (handle being killed by lava)
        if (GameController.CheckIfGameEnds())
        {
            UpdateProfile(false);
            gc.DisplayGameOverMessage();
        }
        // Disable UI and focus camera on another player alive
        if (photonView.isMine)
        {
            DisableAndObserveOtherPlayer();
        }
    }