2022-11-17 12:54:08 +08:00
|
|
|
|
using SHADE;
|
|
|
|
|
using System;
|
|
|
|
|
public class ScoringZone : Script
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
protected override void awake()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void onTriggerEnter(CollisionInfo info)
|
|
|
|
|
{
|
2023-01-31 18:13:34 +08:00
|
|
|
|
if (GameManager.Instance && info.GameObject.GetScript<Item>())
|
2022-11-17 12:54:08 +08:00
|
|
|
|
{
|
2022-11-23 00:44:27 +08:00
|
|
|
|
Audio.PlaySFXOnce2D("event:/Music/stingers/item_scored");
|
2023-01-31 18:13:34 +08:00
|
|
|
|
GameManager.Instance.Score += info.GameObject.GetScript<Item>().Score;
|
|
|
|
|
GameManager.Instance.totalItemCount -= 1;
|
2022-11-17 12:54:08 +08:00
|
|
|
|
info.GameObject.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|