diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs index 29da0b7..79e8344 100644 --- a/Assets/Scripts/GameController.cs +++ b/Assets/Scripts/GameController.cs @@ -83,12 +83,6 @@ void Start() GameEvents.instance.OnLoose += DoOnLoose; GameEvents.instance.OnLooseEnd += DoOnLooseEnd; - // GameEvents.instance.OnRemember += DoOnRemember; - // GameEvents.instance.OnRememberEnd += DoOnRememberEnd; - - // GameEvents.instance.OnRepeat += DoOnRepeat; - // GameEvents.instance.OnRepeatEnd += DoOnRepeatEnd; - GameEvents.instance.OnHelp += DoOnHelp; DoOnMenu(); @@ -125,30 +119,6 @@ private void DoOnMenu() SwitchTo(menu); } - /* #################### Remember State #################### */ - - // private void DoOnRemember() - // { - // GameStore.instance.ResetAfterRemember(); - - // prepare.Start(); - // prepare.Unbind(); - - // states.ForEach(state => state.Unbind()); - // states.Add(prepare); - // states.Add(remember); - // states.ForEach(state => state.Start()); - - // GameEvents.instance.TriggerCountRestart(); - // GameStore.instance.LockLevel(); - // } - - // private void DoOnRememberEnd() - // { - // GameStore.instance.ResetAfterRememberEnd(); - // GameEvents.instance.TriggerPrepare(); - // } - /* #################### Prepare State #################### */ private void DoOnPrepare() @@ -194,30 +164,6 @@ public void DoOnHelp() GameEvents.instance.TriggerCountRestart(); } - /* #################### Repeat State #################### */ - - // private void DoOnRepeat() - // { - // GameStore.instance.ResetAfterRepeat(); - - // state.Unbind(); - // state = repeat; - // state.Start(); - - // GameEvents.instance.TriggerCountRestart(); - // } - - // private void DoOnRepeatEnd() - // { - // GameStore.instance.ResetAfterRepeatEnd(); - - // state.Unbind(); - // state = playing; - // state.Start(); - - // GameEvents.instance.TriggerCountRestart(); - // } - /* #################### Win State #################### */ private void DoOnWin() diff --git a/Assets/Scripts/GameEvents.cs b/Assets/Scripts/GameEvents.cs index 983c567..530d948 100644 --- a/Assets/Scripts/GameEvents.cs +++ b/Assets/Scripts/GameEvents.cs @@ -138,50 +138,6 @@ public void TriggerPrepareEnd() } } - /* #################### Remember Events #################### */ - - // public event Action OnRemember; - - // public void TriggerRemember() - // { - // if (OnRemember != null) - // { - // OnRemember(); - // } - // } - - // public event Action OnRememberEnd; - - // public void TriggerRememberEnd() - // { - // if (OnRememberEnd != null) - // { - // OnRememberEnd(); - // } - // } - - /* #################### Repeat Events #################### */ - - // public event Action OnRepeat; - - // public void TriggerRepeat() - // { - // if (OnRepeat != null) - // { - // OnRepeat(); - // } - // } - - // public event Action OnRepeatEnd; - - // public void TriggerRepeatEnd() - // { - // if (OnRepeatEnd != null) - // { - // OnRepeatEnd(); - // } - // } - /* #################### Help Events #################### */ public event Action OnHelp; diff --git a/Assets/Scripts/GameStore.cs b/Assets/Scripts/GameStore.cs index 7d73aa4..18b79ad 100644 --- a/Assets/Scripts/GameStore.cs +++ b/Assets/Scripts/GameStore.cs @@ -101,30 +101,6 @@ public void ResetAfterWinEnd() NextScore(); } - /* #################### Remember State #################### */ - - // public void ResetAfterRemember() - // { - // timer = REMEMBER_DELAY; - // } - - // public void ResetAfterRememberEnd() - // { - // ResetTimer(); - // } - - /* #################### Repeat State #################### */ - - // public void ResetAfterRepeat() - // { - // timer = REPEAT_DELAY; - // } - - // public void ResetAfterRepeatEnd() - // { - // ResetTimer(); - // } - /* #################### Fail State #################### */ public void ResetAfterLoose() diff --git a/Assets/Scripts/RememberState.cs b/Assets/Scripts/RememberState.cs index d62cde3..d812ef2 100644 --- a/Assets/Scripts/RememberState.cs +++ b/Assets/Scripts/RememberState.cs @@ -11,7 +11,6 @@ public override void Unbind() game.RememberOverlay.SetActive(false); game.GameOverlay.SetActive(false); game.HelpButton.SetActive(true); - // GameEvents.instance.OnCountEnd -= DoOnCountEnd; } @@ -20,7 +19,6 @@ protected override void DoOnStart() game.RememberOverlay.SetActive(true); game.GameOverlay.SetActive(true); game.HelpButton.SetActive(false); - // GameEvents.instance.OnCountEnd += DoOnCountEnd; LogUtils.LogState(GetType().Name); } @@ -28,9 +26,4 @@ protected override void DoOnStart() protected override void DoOnUpdate() { } - - // private void DoOnCountEnd() - // { - // GameEvents.instance.TriggerRememberEnd(); - // } } diff --git a/Assets/Scripts/RepeatState.cs b/Assets/Scripts/RepeatState.cs index ae0b56c..348134b 100644 --- a/Assets/Scripts/RepeatState.cs +++ b/Assets/Scripts/RepeatState.cs @@ -10,14 +10,12 @@ public override void Unbind() { game.RepeatOverlay.SetActive(false); game.GameOverlay.SetActive(false); - // GameEvents.instance.OnCountEnd -= DoOnCountEnd; } protected override void DoOnStart() { game.RepeatOverlay.SetActive(true); game.GameOverlay.SetActive(true); - // GameEvents.instance.OnCountEnd += DoOnCountEnd; LogUtils.LogState(GetType().Name); } @@ -25,9 +23,4 @@ protected override void DoOnStart() protected override void DoOnUpdate() { } - - // private void DoOnCountEnd() - // { - // GameEvents.instance.TriggerRepeatEnd(); - // } } diff --git a/Assets/Scripts/ReplayHandler.cs b/Assets/Scripts/ReplayHandler.cs index 552a9c0..74364eb 100644 --- a/Assets/Scripts/ReplayHandler.cs +++ b/Assets/Scripts/ReplayHandler.cs @@ -14,7 +14,6 @@ void Update() public void HandleClick() { - // GameEvents.instance.TriggerRemember(); GameEvents.instance.TriggerPrepare(); } } diff --git a/Assets/Scripts/StartHandler.cs b/Assets/Scripts/StartHandler.cs index afe2b35..574fc6e 100644 --- a/Assets/Scripts/StartHandler.cs +++ b/Assets/Scripts/StartHandler.cs @@ -14,7 +14,6 @@ void Update() public void HandleClick() { - // GameEvents.instance.TriggerRemember(); GameEvents.instance.TriggerPrepare(); } } diff --git a/Assets/Scripts/ToolbarController.cs b/Assets/Scripts/ToolbarController.cs index ddab4c1..afbb2ad 100644 --- a/Assets/Scripts/ToolbarController.cs +++ b/Assets/Scripts/ToolbarController.cs @@ -7,12 +7,9 @@ public class ToolbarController : MonoBehaviour private static readonly char DASH = '–'; private static readonly float FPS = 60f; - // public bool active = true; private int current = 0; - // private int prev = 0; public GameObject RadialTimer; - // public Text display; public Text score; public Text level; @@ -34,7 +31,6 @@ void Update() private void Restart() { - // SetActive(); ResetTimerFill(); StartCoroutine(CountdownStart()); StartCoroutine(RadialTimerStart()); @@ -47,7 +43,6 @@ private float GetTimerStep() private void DoOnCountRestart() { - // Show(); StopAllCoroutines(); ResetTimer(); Restart(); @@ -59,10 +54,6 @@ private IEnumerator RadialTimerStart() { while (IsRunning()) { - // if (!active) - // { - // yield break; - // } RadialTimer.GetComponent().fillAmount += GetTimerStep(); yield return new WaitForFixedUpdate(); } @@ -72,21 +63,14 @@ private IEnumerator CountdownStart() { while (IsRunning()) { - // if (!active) - // { - // yield break; - // } - // UpdateText(); yield return new WaitForSeconds(1f); DecrementTimer(); } - // UpdateText(); GameEvents.instance.TriggerCountEnd(); } private void ResetTimer() { - // prev = current; current = GameStore.instance.timer; } @@ -102,14 +86,6 @@ private bool IsRunning() private void UpdateScoreText() { - // if (GameStore.instance.win || GameStore.instance.loose) - // { - // display.text = prev.ToString(); - // } - // else - // { - // display.text = current.ToString(); - // } score.text = GameStore.instance.score.ToString(); } @@ -120,16 +96,6 @@ private void UpdateLevelText() level.text = $"{weight}{DASH}{step}"; } - // private void SetActive() - // { - // active = true; - // } - - // private void SetInactive() - // { - // active = false; - // } - public void HideTimer() { RadialTimer.SetActive(false);