Files
DougDiggem/Assets/Scripts/Shovel.cs
T
2026-03-25 17:58:18 -05:00

27 lines
521 B
C#

using UnityEngine;
public class Shovel : Tool
{
public Animator shovelAnimator;
public override void Use()
{
shovelAnimator.SetTrigger("Dig");
}
public override void UseAlt()
{
// no tool
}
// this only works if this script is sitting on the object with the collider!!
private void OnTriggerEnter(Collider other)
{
Diggable diggable = other.GetComponent<Diggable>();
if (diggable != null)
{
diggable.Dig();
}
}
}