SHADE_Y3/Assets/Scripts/Gameplay/SC_ScoringZone.cs

23 lines
773 B
C#
Raw Permalink Normal View History

using SHADE;
2023-02-03 19:37:18 +08:00
using SHADE_Scripting.Audio;
using System;
public class ScoringZone : Script
{
protected override void awake()
{
2023-02-03 19:37:18 +08:00
AudioHandler.audioClipHandlers["SFXItemScore"] = Audio.CreateAudioClip("event:/Music/stingers/item_scored");
}
protected override void onTriggerEnter(CollisionInfo info)
{
if (GameManager.Instance && info.GameObject.GetScript<Item>() && info.GameObject.IsActiveSelf && !info.GameObject.GetComponent<Collider>().GetCollisionShape(0).IsTrigger )
{
2023-02-04 01:45:34 +08:00
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo;
GameManager.Instance.ItemScored();
info.GameObject.SetActive(false);
}
}
}