private void ThunderstrikeUpdate() { if (Timer.IsInProgress()) { if (WithinPerfectStrikeWindow(Timer.GetProgress())) { Debug.Log($"currently WithinPerfectStrikeWindow"); } else if (WithinGoodStrikeWindow(Timer.GetProgress())) { Debug.Log($"currently WithinGoodStrikeWindow"); } float progress = Timer.GetProgress(); //AnimateThunderstrike(progress); // Keep handy for debugging with colours! if (!ActionCommandPressed && Input.GetButtonDown("Action Command")) { Debug.Log("Action Command pressed during Thunderstrike Phase"); MomentOfActionCommand = Timer.GetProgress(); ActionCommandPressed = true; if (WithinPerfectStrikeWindow(Timer.GetProgress())) { PerfectActionCommandSound.Play(); } else if (WithinGoodStrikeWindow(Timer.GetProgress())) { GoodActionCommandSound.Play(); } else { MissedActionCommandSound.Play(); } } if (!ThunderHasAppeared && Timer.GetProgress() >= TimeWindowForStrikes / 2) { SpawnThunderBolt(); StartCoroutine(DamageVictim(GoodStrikeTimeWindow / 2)); } } if (Timer.IsFinished()) { CurrentPhase = ThunderstormPhase.Inactive; if (CurrentThunderStrike < TotalThunderStrikes) { Invoke(nameof(NewThunderStrike), Random.Range(StrikeTimeInterval, 1.5f * StrikeTimeInterval)); } else { EndAbility(); } } }
private void OnCorrectInput() { Debug.Log("OnCorrectInput"); PerfectActionCommandSound.Play(); CorrectInputs += 1; Sequence.RemoveAt(0); }