I’m using Animation to move a panel so it slides up from the bottom. Just like an action sheet on iOS.
I have an Animator on my panel. There is the default state that connects to the open state. The open state connects to the close state. The transition between open and close sets an “open” condition to false. On the open state I added a behavior which overrides the different OnStateXXX methods. None of the methods ever get called.
I also adding events to the timeline and assigned a method to it but the events never fire.
I’m wondering if there is a simple settings I’m somehow missing.
UPDATE
I added a sample project to this issue.
public class PayWithPanelState : StateMachineBehaviour
{
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
Debug.Log("OnStateExit");
base.OnStateExit(animator, stateInfo, layerIndex);
}
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
{
Debug.Log("OnStateExit");
base.OnStateExit(animator, stateInfo, layerIndex, controller);
}
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
Debug.Log("OnStateEnter");
base.OnStateEnter(animator, stateInfo, layerIndex);
}
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
{
Debug.Log("OnStateEnter");
base.OnStateEnter(animator, stateInfo, layerIndex, controller);
}
public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
Debug.Log("OnStateUpdate");
base.OnStateUpdate(animator, stateInfo, layerIndex);
}
public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex, AnimatorControllerPlayable controller)
{
Debug.Log("OnStateUpdate");
base.OnStateUpdate(animator, stateInfo, layerIndex, controller);
}
}
9391433–1313921–TestAnimationEvents.zip (40.1 KB)



