Closed luzhuang closed 2 months ago
The changes encompass enhancements to the animation system, focusing on state transitions and exit time management. Key modifications include the introduction of the hasExitTime
property across various classes, refined transition logic, and updates to method signatures for improved clarity. Additionally, the AnimatorStateTransitionCollection
class has been introduced to streamline transition management, consolidating logic for adding and removing transitions.
Files | Change Summary |
---|---|
packages/core/src/animation/Animator.ts , packages/core/src/animation/AnimatorStateMachine.ts , packages/core/src/animation/AnimatorStateTransition.ts , packages/core/src/animation/AnimatorState.ts |
Enhanced transition handling with the introduction of hasExitTime , refined state transition logic, and improved method signatures for clarity. |
packages/core/src/animation/AnimatorStateTransitionCollection.ts |
Added AnimatorStateTransitionCollection class for centralized management of animator state transitions, including methods for adding, removing, and updating transitions. |
tests/src/core/Animator.test.ts |
Introduced Entity class for state management, removed outdated transition time calculations, and added new tests for validating transition behaviors. |
sequenceDiagram
participant Animator
participant AnimatorStateMachine
participant AnimatorStateTransition
Animator->>AnimatorStateMachine: Request transition
AnimatorStateMachine->>AnimatorStateTransition: Check hasExitTime
alt hasExitTime is true
AnimatorStateTransition->>AnimatorStateMachine: Retrieve exit time
AnimatorStateMachine->>AnimatorStateTransition: Determine transition order
else hasExitTime is false
AnimatorStateTransition->>AnimatorStateMachine: Add transition to front
end
AnimatorStateMachine->>Animator: Execute transition
🐇 In the world of hops and leaps,
New transitions dance and sweep.
With exit times now clear and bright,
Our animations take to flight!
So let us cheer, with joy and glee,
For smoother moves, oh what a spree! 🎉
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information:
Summary by CodeRabbit
New Features
hasExitTime
property for more nuanced control over transitions.AnimatorStateTransitionCollection
for structured transition management.Bug Fixes
Documentation
Tests