Esempio n. 1
0
    void Awake()
    {
        didGameFinished = false;

        if (instance != null)
        {
            Debug.LogError("More than one ScreenManager in scene!");
            return;
        }

        instance = this;

        if (MenuGameMusicManager.instance != null && MenuGameMusicManager.instance.audioSource.isPlaying)
        {
            StartCoroutine(AudioController.FadeOut(MenuGameMusicManager.instance.audioSource, 0.2f));
        }

        if (GameMusicManager.instance != null && !GameMusicManager.instance.audioSource.isPlaying)
        {
            StartCoroutine(AudioController.FadeIn(GameMusicManager.instance.audioSource, 1f));
        }

        GamePreservedStats.instance.ResetStats();

        audioSource = GetComponent <AudioSource>();
        //audioSource.PlayOneShot(backgroundMusic, 0.1f);

        countdownTimerScript = gameScreenUI.GetComponent <CountdownTimer>();
        eggsPanelScript      = GetComponent <EggsPanel>();

        // Initialize the player's color always to a correct one.
        playerScript = playerGO.GetComponent <Player>();
        GameColor firstEggColor = eggsPanelScript.GetEggs()[0].Color;

        playerScript.ChangeToADesiredColor(firstEggColor);
        playerScript.SetEggsPanelScript(eggsPanelScript);

        medalsScript = medalsGO.GetComponent <MedalsBehaviour>();

        screenButtonsScript         = GetComponentInChildren <ScreenButtons>();
        screenButtonsScript.enabled = false;
    }
Esempio n. 2
0
 public void SetEggsPanelScript(EggsPanel epScript)
 {
     this.eggsPanelScript = epScript;
 }
Esempio n. 3
0
 public virtual void SetEggsPanel(EggsPanel ep)
 {
 }
Esempio n. 4
0
 public override void SetEggsPanel(EggsPanel ep)
 {
     this.eggsPanel = ep;
 }