24 lines
487 B
C#
24 lines
487 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class CuttingCounterVisual : MonoBehaviour
|
|
{
|
|
private static readonly int cut = Animator.StringToHash("Cut");
|
|
[SerializeField] private CuttingCounter cuttingCounter;
|
|
private Animator animator;
|
|
|
|
private void Awake()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
cuttingCounter.OnCut += CuttingCounter_OnCut;
|
|
}
|
|
|
|
private void CuttingCounter_OnCut(object sender, System.EventArgs e)
|
|
{
|
|
animator.SetTrigger(cut);
|
|
}
|
|
} |