TO SQUASH: Code formatting changes.
This commit is contained in:
@@ -124,6 +124,6 @@ public class Player : MonoBehaviour
|
||||
musicManager.pauseMusic();
|
||||
audioSource.PlayOneShot(defeat);
|
||||
yield return new WaitForSeconds(1.3f);
|
||||
fader.resetFader();
|
||||
fader.ResetFader();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ public class IntroSkipper : MonoBehaviour
|
||||
||
|
||||
mouse != null && mouse.leftButton.wasPressedThisFrame)
|
||||
{
|
||||
fadeIn.forceStopAudioCoroutine();
|
||||
fadeIn.ForceStopAudioCoroutine();
|
||||
if (fadeOut != null) {
|
||||
fadeOut.resetFader();
|
||||
fadeOut.ResetFader();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Fader : MonoBehaviour
|
||||
sprite = GetComponent<SpriteRenderer>();
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user