SHADE_Y3/Assets/Scripts/Gameplay/SC_ScoringZone.cs

22 lines
505 B
C#
Raw Normal View History

using SHADE;
using System;
public class ScoringZone : Script
{
public GameManager gameManger { get; set; }
protected override void awake()
{
}
protected override void onTriggerEnter(CollisionInfo info)
{
if (gameManger && info.GameObject.GetScript<Item>())
{
2022-11-23 00:44:27 +08:00
Audio.PlaySFXOnce2D("event:/Music/stingers/item_scored");
gameManger.Score += info.GameObject.GetScript<Item>().Score;
gameManger.totalItemCount -= 1;
info.GameObject.SetActive(false);
}
}
}