2022-11-17 12:54:08 +08:00
|
|
|
|
using SHADE;
|
2023-02-03 19:37:18 +08:00
|
|
|
|
using SHADE_Scripting.Audio;
|
2022-11-17 12:54:08 +08:00
|
|
|
|
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");
|
2022-11-17 12:54:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void onTriggerEnter(CollisionInfo info)
|
|
|
|
|
{
|
2023-02-04 01:11:47 +08:00
|
|
|
|
if (GameManager.Instance && info.GameObject.GetScript<Item>() && info.GameObject.IsActiveSelf)
|
2022-11-17 12:54:08 +08:00
|
|
|
|
{
|
2023-02-04 01:45:34 +08:00
|
|
|
|
AudioHandler.audioClipHandlers["SFXItemScore"].Play();
|
2023-02-02 22:44:30 +08:00
|
|
|
|
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score * GameManager.Instance.currMultiplierCombo;
|
2023-02-04 01:11:47 +08:00
|
|
|
|
GameManager.Instance.ItemScored();
|
2022-11-17 12:54:08 +08:00
|
|
|
|
info.GameObject.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|