-
-
Notifications
You must be signed in to change notification settings - Fork 397
Revert "Allow anyState transitions to interrupt crossFade & fix transition bugs" #2891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,25 +94,20 @@ export class AnimatorStateTransitionCollection { | |
| private _addTransition(transition: AnimatorStateTransition): void { | ||
| const transitions = this.transitions; | ||
|
|
||
| // NoExitTime transitions are stored at the front of the array [0, noExitTimeCount) | ||
| if (!transition.hasExitTime) { | ||
| transitions.unshift(transition); | ||
| this.noExitTimeCount++; | ||
| return; | ||
| } | ||
|
|
||
| // HasExitTime transitions are sorted by exitTime in range [noExitTimeCount, count) | ||
| const { exitTime } = transition; | ||
| const { noExitTimeCount } = this; | ||
| const count = transitions.length; | ||
| // Only compare with hasExitTime transitions (after noExitTimeCount) | ||
| const maxExitTime = count > noExitTimeCount ? transitions[count - 1].exitTime : 0; | ||
| const maxExitTime = count ? transitions[count - 1].exitTime : 0; | ||
| if (exitTime >= maxExitTime) { | ||
| transitions.push(transition); | ||
| } else { | ||
| let index = count; | ||
| // Stop at noExitTimeCount boundary to avoid comparing with noExitTime transitions | ||
| while (--index >= noExitTimeCount && exitTime < transitions[index].exitTime); | ||
| while (--index >= 0 && exitTime < transitions[index].exitTime); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The insertion loop for Severity: high 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| transitions.splice(index + 1, 0, transition); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_checkNoExitTimeTransition()now iterates overtransitionCollection.count(all transitions) even though it’s only called whennoExitTimeCount > 0. This can allowhasExitTimetransitions to be applied immediately (bypassing exit-time gating) if their conditions pass after the no-exit-time transitions fail.Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.