SHADE_Y3/Assets/Scripts/SC_ScoringZone.cs

21 lines
441 B
C#

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>())
{
gameManger.Score += info.GameObject.GetScript<Item>().Score;
gameManger.totalItemCount -= 1;
info.GameObject.SetActive(false);
}
}
}