diff --git a/src/components/AssetsManagement/AssetSelector.vue b/src/components/AssetsManagement/AssetSelector.vue index 341da77..12e5e26 100644 --- a/src/components/AssetsManagement/AssetSelector.vue +++ b/src/components/AssetsManagement/AssetSelector.vue @@ -3,7 +3,7 @@ - {{ v.id }} + {{ v.name }} diff --git a/src/components/InteractiveObjects/CharacterObject.js b/src/components/InteractiveObjects/CharacterObject.js new file mode 100644 index 0000000..6d53cc2 --- /dev/null +++ b/src/components/InteractiveObjects/CharacterObject.js @@ -0,0 +1,11 @@ +class CharacterObject{ + constructor(engine, data){ + return new Promise(async(resolve, reject)=>{ + this.source = await engine.load(data.$go.asset.name); + this.object = this.source.scene; + resolve(this); + }) + } +} + +export { CharacterObject } \ No newline at end of file diff --git a/src/components/InteractiveObjects/CharacterObject.vue b/src/components/InteractiveObjects/CharacterObject.vue new file mode 100644 index 0000000..17f7ee2 --- /dev/null +++ b/src/components/InteractiveObjects/CharacterObject.vue @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/src/components/InteractiveObjects/InteractiveObject.js b/src/components/InteractiveObjects/InteractiveObject.js index ef8d1c3..b6446bb 100644 --- a/src/components/InteractiveObjects/InteractiveObject.js +++ b/src/components/InteractiveObjects/InteractiveObject.js @@ -1,20 +1,23 @@ import { Group } from "three"; import { GenericObject } from "./GenenricObject"; +import { TextObject } from "./TextObject"; +import { ImageObject } from "./ImageObject"; +import { CharacterObject } from "./CharacterObject"; +import { VideoPlayer } from "./VideoPlayer"; import { PuzzleGame1 } from "./PuzzleGame1"; import { PuzzleGame2 } from "./PuzzleGame2"; // import { Game3 } from "./games/Game3"; import { PuzzleGame4 } from "./PuzzleGame4"; // import { Game5 } from "./games/Game5"; // import { Game6 } from "./games/Game6"; -import { TextObject } from "./TextObject"; -import { ImageObject } from "./ImageObject"; -import { VideoPlayer } from "./VideoPlayer"; import { MazeQuizGame } from "./MazeQuizGame/MazeQuizGame"; import { Particles } from "./Particles"; import { assignMaterial, assignParams } from "@/lib/MeshUtils"; -const InteractiveObjectsImports = { PuzzleGame1, PuzzleGame2, PuzzleGame4, MazeQuizGame, Particles }; +const InteractiveObjectsImports = { + PuzzleGame1, PuzzleGame2, PuzzleGame4, + GenericObject, CharacterObject, MazeQuizGame, Particles }; class InteractiveObject { constructor(gameEngine, obj) { @@ -61,7 +64,8 @@ class InteractiveObject { this.source = gltf; break; case 'GenericObject': - let go = await new GenericObject(gameEngine, obj) //await gameEngine.load(obj.$go.asset.name); + case 'CharacterObject': + let go = await new InteractiveObjectsImports[obj.type](gameEngine, obj) //await gameEngine.load(obj.$go.asset.name); this.source = go.source; this.object = go.object; break; @@ -82,7 +86,6 @@ class InteractiveObject { case 'PuzzleGame2': case 'MazeQuizGame': case 'Particles': - console.log(obj.type); this.source = await new InteractiveObjectsImports[obj.type](gameEngine, obj); this.object = this.source.object; break; @@ -95,6 +98,8 @@ class InteractiveObject { const InteractiveObjectTypes = [ { + id: 'CharacterObject', name: 'Character' + }, { id: 'PuzzleGame1', name: 'Puzzle Game 1' },{ id: 'PuzzleGame2', name: 'Puzzle Game 2' diff --git a/src/components/InteractiveObjects/PuzzleGame1.vue b/src/components/InteractiveObjects/PuzzleGame1.vue index 89bacbb..bc3d209 100644 --- a/src/components/InteractiveObjects/PuzzleGame1.vue +++ b/src/components/InteractiveObjects/PuzzleGame1.vue @@ -1,12 +1,10 @@