Add scene readiness check in RuntimeHost
This commit is contained in:
@@ -1287,7 +1287,12 @@ export class RuntimeHost {
|
|||||||
mixer.update(dt);
|
mixer.update(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.runtimeScene !== null && this.activeController === this.firstPersonController && this.currentFirstPersonTelemetry !== null) {
|
if (
|
||||||
|
this.sceneReady &&
|
||||||
|
this.runtimeScene !== null &&
|
||||||
|
this.activeController === this.firstPersonController &&
|
||||||
|
this.currentFirstPersonTelemetry !== null
|
||||||
|
) {
|
||||||
this.interactionSystem.updatePlayerPosition(this.currentFirstPersonTelemetry.feetPosition, this.runtimeScene, this.createInteractionDispatcher());
|
this.interactionSystem.updatePlayerPosition(this.currentFirstPersonTelemetry.feetPosition, this.runtimeScene, this.createInteractionDispatcher());
|
||||||
this.camera.getWorldDirection(this.cameraForward);
|
this.camera.getWorldDirection(this.cameraForward);
|
||||||
this.setInteractionPrompt(
|
this.setInteractionPrompt(
|
||||||
@@ -1407,16 +1412,24 @@ export class RuntimeHost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleRuntimeClick = () => {
|
private handleRuntimeClick = () => {
|
||||||
this.audioSystem.handleUserGesture();
|
if (
|
||||||
|
!this.sceneReady ||
|
||||||
if (this.runtimeScene === null || this.activeController !== this.firstPersonController || this.currentInteractionPrompt === null) {
|
this.runtimeScene === null ||
|
||||||
|
this.activeController !== this.firstPersonController ||
|
||||||
|
this.currentInteractionPrompt === null
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.audioSystem.handleUserGesture();
|
||||||
this.interactionSystem.dispatchClickInteraction(this.currentInteractionPrompt.sourceEntityId, this.runtimeScene, this.createInteractionDispatcher());
|
this.interactionSystem.dispatchClickInteraction(this.currentInteractionPrompt.sourceEntityId, this.runtimeScene, this.createInteractionDispatcher());
|
||||||
};
|
};
|
||||||
|
|
||||||
private handleRuntimePointerDown = () => {
|
private handleRuntimePointerDown = () => {
|
||||||
|
if (!this.sceneReady) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.audioSystem.handleUserGesture();
|
this.audioSystem.handleUserGesture();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user