25 lines
567 B
C#
25 lines
567 B
C#
using UnityEngine;
|
|
using Core.Lifecycle;
|
|
using Core.SaveLoad;
|
|
|
|
public class AnimationEvents : ManagedBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public AppleMachine stateMachine;
|
|
|
|
internal override void OnManagedAwake()
|
|
{
|
|
stateMachine = GetComponentInParent<AppleMachine>();
|
|
if (stateMachine == null)
|
|
{
|
|
Debug.Log($"[AnimationEvent] Animated state {name} does not have a valid state machine!");
|
|
}
|
|
}
|
|
|
|
public void AnimSwitchState(string stateToGoTo)
|
|
{
|
|
stateMachine.ChangeState(stateToGoTo);
|
|
}
|
|
|
|
}
|