Skip to content

Commit

Permalink
Remove motionPreload property in MotinoManager
Browse files Browse the repository at this point in the history
Breaking change.
  • Loading branch information
guansss committed Jan 21, 2021
1 parent 3f57868 commit 11fc6a4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/cubism-common/MotionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ export abstract class MotionManager<Motion = any, MotionSpec = any> extends Even
*/
currentAudio?: HTMLAudioElement;

// TODO: remove it
/** @ignore */
motionPreload: MotionPreloadStrategy = MotionPreloadStrategy.IDLE;

/**
* Flags there's a motion playing.
*/
Expand All @@ -108,8 +104,6 @@ export abstract class MotionManager<Motion = any, MotionSpec = any> extends Even
this.settings = settings;
this.tag = `MotionManager(${settings.name})`;
this.state.tag = this.tag;

this.motionPreload = options?.motionPreload ?? this.motionPreload;
}

/**
Expand All @@ -120,14 +114,14 @@ export abstract class MotionManager<Motion = any, MotionSpec = any> extends Even
this.groups.idle = options.idleMotionGroup;
}

this.setupMotions();
this.setupMotions(options);
this.stopAllMotions();
}

/**
* Sets up motions from the definitions, and preloads them according to the preload strategy.
*/
protected setupMotions(): void {
protected setupMotions(options?: MotionManagerOptions): void {
for (const group of Object.keys(this.definitions)) {
// init with the same structure of definitions
this.motionGroups[group] = [];
Expand All @@ -137,7 +131,7 @@ export abstract class MotionManager<Motion = any, MotionSpec = any> extends Even

let groups;

switch (this.motionPreload) {
switch (options?.motionPreload) {
case MotionPreloadStrategy.NONE:
return;

Expand Down

0 comments on commit 11fc6a4

Please sign in to comment.