Hi all,
I am having some strange issues with hooking into the TrackEntry callback events.
I know the events are being raised as I can catch them via the skeletonAnimation.state but when hooking into the TrackEntry themself some are not working
here is what I have in a simplyfied manner
void Start(){
skeletonAnimation.state.Start += HandleStart;
}
private void HandleStart(TrackEntry tE)
{
if (tE.Animation.Name == Idle)
{
//do something, this functions
}
}
void PlayNewStableAnimation()
{
WarriorSCBodyState newModelState = model.state;
if (newModelState == WarriorSCBodyState.Idle)
{
renderSeparator.enabled = false;
TrackEntry idleEntry = skeletonAnimation.state.SetAnimation(0, Idle, true);
idleEntry.mixDuration = 0f;
idleEntry.timeScale = 0.55f;
idleEntry.Start += HandleIdleStart;
}
}
private void HandleIdleStart(TrackEntry trackEntry)
{
//Do something else, this doesn't get raised.
}
The weird thing is that hooking into the specific TE works for some events.
- Complete always works
- Start seems to work but only for Animations added via the AddAnimation, not the SetAnimation
- End never works
Is there any reason for this? Hooking into the TE seems nicer and more managable then having a general HandleStart method where you then proceed to switch based on Animation name ...