Skip to content

Multiple Events Not looping Correctly  #120

@Jammarman

Description

@Jammarman

I'm having an issue, for the first play through of the animation all 4 of my events are called. But after the animation loops only one event gets called per loop.
I think the issue is with the Loop mode in AnimationInstancing.cs, method "UpdateAnimation();".

I think when the curFrame is reset to the start of the animatino"UpdateAnimationEvent()" is still comparing the last event from the previous loop.
So it only cycles through one event per loop?

I think I have fixed it by setting aniEvent and eventIndex to null and -1 when resetting the loop. It also affects the PingPong Wrapmode


case WrapMode.Loop:
{
     if (curFrame < 0f)
     curFrame += (totalFrame - 1);
     else if (curFrame > totalFrame - 1)
{
     curFrame -= (totalFrame-1);
     aniEvent = null;
     eventIndex = -1;
 }

break;


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions