tnt graphics, bug fixes, folder organization
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Shovel : Tool
|
||||
{
|
||||
[Header("Shovel Parameters")]
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user