tool system with switching
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Shovel : MonoBehaviour
|
||||
public class Shovel : Tool
|
||||
{
|
||||
public Animator shovelAnimator;
|
||||
|
||||
public void Dig()
|
||||
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user