Skip to content

Commit

Permalink
fixed broken avatar position updated for story NPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
DerKatsche committed Feb 21, 2024
1 parent f8b2294 commit 25975f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class LearningSpacePresenter implements ILearningSpacePresenter {
private decorationBuilder: IDecorationBuilder;
private doorPresenters: IDoorPresenter[] = [];
private elementPresenters: ILearningElementPresenter[] = [];
private storyNPCPresenters: IStoryNPCPresenter;
private storyNPCPresenters: IStoryNPCPresenter[] = [];

constructor(private viewModel: LearningSpaceViewModel) {
if (!this.viewModel) {
Expand Down Expand Up @@ -56,11 +56,8 @@ export default class LearningSpacePresenter implements ILearningSpacePresenter {
for (const elementPresenter of this.elementPresenters) {
elementPresenter.onAvatarPositionChanged(position, interactionRadius);
}
if (this.storyNPCPresenters)
this.storyNPCPresenters.onAvatarPositionChanged(
position,
interactionRadius
);
for (const npcPresenter of this.storyNPCPresenters)
npcPresenter.onAvatarPositionChanged(position, interactionRadius);
}

private async fillLearningElementSlots(
Expand Down Expand Up @@ -178,7 +175,7 @@ export default class LearningSpacePresenter implements ILearningSpacePresenter {

await this.director.buildAsync(storyNPCBuilder);

this.storyNPCPresenters = storyNPCBuilder.getPresenter();
this.storyNPCPresenters.push(storyNPCBuilder.getPresenter());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ import { StoryElementType } from "src/Components/Core/Domain/Types/StoryElementT

export default interface IStoryNPCPresenter extends ILearningWorldAdapter {
onAvatarPositionChanged(position: Vector3, interactionRadius: number): void;
onStoryElementCutSceneTriggered(storyType: StoryElementType): void;
onStoryElementCutSceneFinished(): void;
}

0 comments on commit 25975f7

Please sign in to comment.