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; }
public void SetEggsPanelScript(EggsPanel epScript) { this.eggsPanelScript = epScript; }
public virtual void SetEggsPanel(EggsPanel ep) { }
public override void SetEggsPanel(EggsPanel ep) { this.eggsPanel = ep; }