Skip to content

Commit

Permalink
refactor: opt code
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoLei1990 committed Sep 10, 2024
1 parent 2e63e45 commit c7cc55a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/core/src/animation/Animator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ export class Animator extends Component {

const transition =
(anyStateTransitions.count &&
this._applyTransitionsByCondition(layerIndex, layerData, layer, state, anyStateTransitions, true, aniUpdate)) ||
this._applyTransitionsByCondition(layerIndex, layerData, layer, anyStateTransitions, aniUpdate)) ||
(transitions.count &&
this._applyStateTransitions(
layerIndex,
Expand Down Expand Up @@ -1205,14 +1205,12 @@ export class Animator extends Component {
layerIndex: number,
layerData: AnimatorLayerData,
layer: AnimatorControllerLayer,
state: AnimatorState,
transitions: AnimatorStateTransitionCollection,
checkStateMachineTransition: boolean,
aniUpdate: boolean
): AnimatorStateTransition {
const isSoloMode = transitions.isSoloMode;
for (let i = 0, n = transitions.count; i < n; i++) {
const transition = transitions[i];
const transition = transitions.get(i);

if (transition.mute) continue;

Expand Down Expand Up @@ -1473,12 +1471,12 @@ export class Animator extends Component {

transition =
anyStateTransitions.count &&
this._applyTransitionsByCondition(layerIndex, layerData, layer, null, anyStateTransitions, true, aniUpdate);
this._applyTransitionsByCondition(layerIndex, layerData, layer, anyStateTransitions, aniUpdate);

if (!transition) {
transition =
entryTransitions.count &&
this._applyTransitionsByCondition(layerIndex, layerData, layer, null, entryTransitions, true, aniUpdate);
this._applyTransitionsByCondition(layerIndex, layerData, layer, entryTransitions, aniUpdate);
}

if (transition) {
Expand Down

0 comments on commit c7cc55a

Please sign in to comment.