SHADE_Y3/Assets/Scripts/Gameplay/SC_ScoringZone.cs

23 lines
773 B
C#

using SHADE;
using SHADE_Scripting.Audio;
using System;
public class ScoringZone : Script
{
protected override void awake()
{
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 )
{
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo;
GameManager.Instance.ItemScored();
info.GameObject.SetActive(false);
}
}
}