diff --git a/Assets/Scripts/Game/Player.cs b/Assets/Scripts/Game/Player.cs index 170ed52..e27d7ad 100644 --- a/Assets/Scripts/Game/Player.cs +++ b/Assets/Scripts/Game/Player.cs @@ -124,6 +124,6 @@ public class Player : MonoBehaviour musicManager.pauseMusic(); audioSource.PlayOneShot(defeat); yield return new WaitForSeconds(1.3f); - fader.resetFader(); + fader.ResetFader(); } } diff --git a/Assets/Scripts/GameOver/ScoreChecker.cs b/Assets/Scripts/GameOver/ScoreChecker.cs index 4afbdf9..89cf826 100644 --- a/Assets/Scripts/GameOver/ScoreChecker.cs +++ b/Assets/Scripts/GameOver/ScoreChecker.cs @@ -21,33 +21,39 @@ public class ScoreChecker : MonoBehaviour } - public void resetFader() + public void ResetFader() { - Invoke(nameof(checkScore), 0.5f); + Invoke(nameof(CheckScore), 0.5f); } private IEnumerator PlayAudioThenActivateGameObject(AudioSource audio, bool showGui) { audio.Play(); - if (showGui) { + if (showGui) + { // Activate your GUI here - } else { + } + else + { yield return new WaitUntil(() => audio.time >= audio.clip.length); - fadeOut.resetFader(); + fadeOut.ResetFader(); } } - void checkScore() + void CheckScore() { int currentScore = PlayerPrefs.GetInt("CurrentScore"); AudioSource audio = null; bool showGui = false; - if (GameSetup.IsHighScore(currentScore)) { + if (GameSetup.IsHighScore(currentScore)) + { audio = winSound; showGui = true; - } else { + } + else + { audio = loseSound; } diff --git a/Assets/Scripts/Intro/Intro.cs b/Assets/Scripts/Intro/Intro.cs index bd30a64..0579f06 100644 --- a/Assets/Scripts/Intro/Intro.cs +++ b/Assets/Scripts/Intro/Intro.cs @@ -26,7 +26,7 @@ public class Intro : FadeCallback public override void OnFadeComplete() { } - public void forceStopAudioCoroutine() + public void ForceStopAudioCoroutine() { if (playAudioCoroutine != null) { @@ -35,13 +35,13 @@ public class Intro : FadeCallback } music.Stop(); - faderScript.Invoke("resetFader", 0.0f); + faderScript.Invoke("ResetFader", 0.0f); } private IEnumerator PlayAudioThenActivateGameObject() { music.Play(); yield return new WaitUntil(() => music.time >= music.clip.length); - faderScript.Invoke("resetFader", 0.0f); + faderScript.Invoke("ResetFader", 0.0f); } } diff --git a/Assets/Scripts/Intro/IntroSkipper.cs b/Assets/Scripts/Intro/IntroSkipper.cs index 65fd95a..1b642eb 100644 --- a/Assets/Scripts/Intro/IntroSkipper.cs +++ b/Assets/Scripts/Intro/IntroSkipper.cs @@ -23,9 +23,9 @@ public class IntroSkipper : MonoBehaviour || mouse != null && mouse.leftButton.wasPressedThisFrame) { - fadeIn.forceStopAudioCoroutine(); + fadeIn.ForceStopAudioCoroutine(); if (fadeOut != null) { - fadeOut.resetFader(); + fadeOut.ResetFader(); } } } diff --git a/Assets/Scripts/Utils/Fader.cs b/Assets/Scripts/Utils/Fader.cs index 418fb0a..db0f7e7 100644 --- a/Assets/Scripts/Utils/Fader.cs +++ b/Assets/Scripts/Utils/Fader.cs @@ -22,7 +22,7 @@ public class Fader : MonoBehaviour sprite = GetComponent(); if (fadeOnStart) { - resetFader(); + ResetFader(); } } @@ -66,17 +66,17 @@ public class Fader : MonoBehaviour } } - public void setFadingIn() + public void SetFadingIn() { isFadingIn = true; } - public void setFadingOut() + public void SetFadingOut() { isFadingIn = false; } - public void resetFader() + public void ResetFader() { startFading = true; timer = 0.0f;