Beispiel #1
0
    void Start()
    {
        interfaceController.TurnIndicatorLightsOff();
        winScreenTimerText = GameObject.Find("WinScreenTimerText");
        if (GameSession.GameMode == GameModeEnum.MULTIPLAYER)
        {
            eventManager.ListenToCountdownTimerValueChanged(updateTimerText);
            eventManager.ListenToCountdownTimer(timerEnded);
            winScreenTimerText.SetActive(true);
        }
        else
        {
            if (winScreenTimerText.activeSelf)
            {
                winScreenTimerText.SetActive(false);
            }
        }

        RenderTexture texture = GetNewRenderTexture();

        winVideoPlayer.targetTexture = texture;

        RawImage winImage = GameObject.Find("WinImage").GetComponent <RawImage>();

        winImage.texture = texture;

        string winnerString = getWhoWon();

        if (winnerString == "You Win!" || winnerString == interfaceController.GetLocalPlayerName() + " Wins!")
        {
            ++GameSession.WinCount;

            cheeseGenerator.Play();
            soundEffectController.PlayWinSound();
            winVideoPlayer.clip = winClip;
        }
        else
        {
            soundEffectController.PlayLoseSound();

            winVideoPlayer.clip = loseClip;
        }

        winVideoPlayer.Play();
    }