Added particle and bug fixes #437

Merged
glencelow merged 7 commits from PlayerController into main 2023-03-24 16:09:43 +08:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit 01cbba1f1f - Show all commits

View File

@ -88,6 +88,8 @@ public class GameManager : Script
Input.SetMouseCentering(true); Input.SetMouseCentering(true);
Application.IsCursorVisible = false; Application.IsCursorVisible = false;
Application.FixDeltaTime = Time.DefaultFixDeltaTime; Application.FixDeltaTime = Time.DefaultFixDeltaTime;
AudioHandler.audioClipHandlers["SFXItemScore"] = Audio.CreateAudioClip("event:/Music/stingers/item_scored");
} }
protected override void start() protected override void start()
@ -244,6 +246,9 @@ public class GameManager : Script
if (currMultiplierCombo < maxMultiplierCombo) if (currMultiplierCombo < maxMultiplierCombo)
currMultiplierCombo += 1; currMultiplierCombo += 1;
Audio.SetParameter("Multiplier", currMultiplierCombo);
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
MultiplierTextFx fx = multiplierText.GetScript<MultiplierTextFx>(); MultiplierTextFx fx = multiplierText.GetScript<MultiplierTextFx>();
if (fx) if (fx)
{ {

View File

@ -6,14 +6,12 @@ public class ScoringZone : Script
protected override void awake() protected override void awake()
{ {
AudioHandler.audioClipHandlers["SFXItemScore"] = Audio.CreateAudioClip("event:/Music/stingers/item_scored");
} }
protected override void onTriggerEnter(CollisionInfo info) protected override void onTriggerEnter(CollisionInfo info)
{ {
if (GameManager.Instance && info.GameObject.GetScript<Item>() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent<Collider>().GetCollisionShape(0).IsTrigger ) if (GameManager.Instance && info.GameObject.GetScript<Item>() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent<Collider>().GetCollisionShape(0).IsTrigger )
{ {
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo; GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo;
GameManager.Instance.ItemScored(); GameManager.Instance.ItemScored();
info.GameObject.SetActive(false); info.GameObject.SetActive(false);