Finished secretary
This commit is contained in:
24
Assets/Scripts/Animation/AnimationEvents.cs
Normal file
24
Assets/Scripts/Animation/AnimationEvents.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user