Files
AppleHillsProduction/Assets/Scripts/Animation/AnimationEvents.cs

25 lines
567 B
C#
Raw Normal View History

2025-12-02 14:49:55 +01:00
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);
}
}