add shovel and digging, basic item interaction

This commit is contained in:
2025-06-25 22:03:13 -05:00
parent 0eda440961
commit 16c8519111
22 changed files with 2412 additions and 38 deletions
+21
View File
@@ -0,0 +1,21 @@
using UnityEngine;
public class Shovel : MonoBehaviour
{
public Animator shovelAnimator;
public void Dig()
{
shovelAnimator.SetTrigger("Dig");
}
// 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();
}
}
}