Skip to content

Commit

Permalink
Parallel animation loading
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusLongmuir committed May 18, 2024
1 parent 6ac3eeb commit 26809cc
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions packages/3d-web-client-core/src/character/CharacterModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,24 @@ export class CharacterModel {

public async init(): Promise<void> {
await this.loadMainMesh();
await this.setAnimationFromFile(
this.config.animationConfig.idleAnimationFileUrl,
AnimationState.idle,
);
await this.setAnimationFromFile(
this.config.animationConfig.jogAnimationFileUrl,
AnimationState.walking,
);
await this.setAnimationFromFile(
this.config.animationConfig.sprintAnimationFileUrl,
AnimationState.running,
);
await this.setAnimationFromFile(
this.config.animationConfig.airAnimationFileUrl,
AnimationState.air,
);
await Promise.all([
this.setAnimationFromFile(
this.config.animationConfig.idleAnimationFileUrl,
AnimationState.idle,
),
this.setAnimationFromFile(
this.config.animationConfig.jogAnimationFileUrl,
AnimationState.walking,
),
this.setAnimationFromFile(
this.config.animationConfig.sprintAnimationFileUrl,
AnimationState.running,
),
this.setAnimationFromFile(
this.config.animationConfig.airAnimationFileUrl,
AnimationState.air,
),
]);
this.applyCustomMaterials();
}

Expand Down

0 comments on commit 26809cc

Please sign in to comment.