20 lines
522 B
C#
20 lines
522 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, EventArgs e) {
|
|
animator.SetTrigger(cut);
|
|
}
|
|
} |