change event dispatcher
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { MazeObject } from "./MazeObject";
|
||||
import Utils from "@/lib/Utils";
|
||||
import { EventDispatcher } from "three";
|
||||
|
||||
const params = {
|
||||
scale: 5,
|
||||
@@ -34,7 +35,7 @@ const defaults = {
|
||||
|
||||
const tl = 4;
|
||||
|
||||
class MazeQuizGame {
|
||||
class MazeQuizGame extends EventDispatcher {
|
||||
constructor(engine, data) {
|
||||
data.noPhysics = true;
|
||||
return new Promise(async (resolve, reject)=>{
|
||||
@@ -57,7 +58,7 @@ class MazeQuizGame {
|
||||
engine.hero.characterControls.direction += Math.PI;
|
||||
//engine.hero.model.rotation.y += Math.PI;
|
||||
await Utils.wait(10000);
|
||||
this.onfinish?.()
|
||||
this.dispatchEvent({type:'finish'})
|
||||
}else{
|
||||
engine.hero.animationsMap.idle = engine.hero.animationsMap._idle
|
||||
engine.hero.characterControls.cameraDelta = 0
|
||||
|
||||
Reference in New Issue
Block a user