Skip to content

Commit

Permalink
feat: remove entryState feature
Browse files Browse the repository at this point in the history
  • Loading branch information
luzhuang committed Oct 11, 2022
1 parent 4fd8c0d commit 31f1d30
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/core/src/animation/AnimatorController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
* Store the data for Animator playback.
*/
export class AnimatorController {
/** @internal */
_onDataChanged: () => void = null;

private _updateFlagManager: UpdateFlagManager = new UpdateFlagManager();
private _layers: AnimatorControllerLayer[] = [];
private _layersMap: Record<string, AnimatorControllerLayer> = {};
Expand All @@ -35,7 +32,7 @@ export class AnimatorController {
addLayer(layer: AnimatorControllerLayer): void {
this._layers.push(layer);
this._layersMap[layer.name] = layer;
this._onChange();
this._distributeUpdateFlag();
}

/**
Expand All @@ -46,7 +43,7 @@ export class AnimatorController {
const theLayer = this.layers[layerIndex];
this._layers.splice(layerIndex, 1);
delete this._layersMap[theLayer.name];
this._onChange();
this._distributeUpdateFlag();
}

/**
Expand All @@ -57,7 +54,7 @@ export class AnimatorController {
for (let name in this._layersMap) {
delete this._layersMap[name];
}
this._onChange();
this._distributeUpdateFlag();
}

/**
Expand All @@ -67,8 +64,7 @@ export class AnimatorController {
return this._updateFlagManager.createFlag(BoolUpdateFlag);
}

private _onChange() {
private _distributeUpdateFlag(): void {
this._updateFlagManager.dispatch();
this._onDataChanged && this._onDataChanged();
}
}

0 comments on commit 31f1d30

Please sign in to comment.