This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { EventManager } from "@/lib/EventManager";
|
||||
import { MeshStandardMaterial, MeshBasicMaterial, PlaneGeometry, Mesh, DoubleSide, Vector3 } from "three";
|
||||
|
||||
class ImageObject {
|
||||
class ImageObject extends EventManager{
|
||||
constructor(engine, obj) {
|
||||
super();
|
||||
return new Promise(async(resolve, reject)=>{
|
||||
if (obj.$go){
|
||||
obj.path = engine.assetPath;
|
||||
@@ -32,6 +34,12 @@ class ImageObject {
|
||||
}
|
||||
this.object = new Mesh(geo, mp.metalness ? new MeshStandardMaterial(mp) : new MeshBasicMaterial(mp));
|
||||
|
||||
if (obj.description) {
|
||||
engine.clickable.add(this.object, ()=>{
|
||||
engine.dashboard.updateText(obj.description, {hideOnFinish: true})
|
||||
})
|
||||
}
|
||||
|
||||
resolve(this)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user