refactoring
This commit is contained in:
@@ -26,7 +26,7 @@ class Clickable {
|
||||
let forExecute = [];
|
||||
objects.filter(o=>{
|
||||
do {
|
||||
if (o.__locked) return false;
|
||||
if (o.__active === false) return false;
|
||||
o = o.parent;
|
||||
} while (o);
|
||||
return true;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { EventDispatcher } from "three";
|
||||
|
||||
class EventManager extends EventDispatcher{
|
||||
forwardEvents(object){
|
||||
this.emits?.forEach(e=>{
|
||||
this.addEventListener(e, object.dispatchEvent.bind(object))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export { EventManager }
|
||||
@@ -2,7 +2,7 @@ import { TextureLoader, Box3, Vector3, Group } from "three";
|
||||
|
||||
function assignParams(mesh, params){
|
||||
['scale', 'rotation', 'position'].forEach(p=>params[p] && mesh[p].fromArray(params[p]));
|
||||
['visible', 'name', 'fontSize', 'color'].forEach(p=>{
|
||||
['visible', 'name', 'fontSize', 'color', 'lineHeight', 'maxWidth', 'anchorX', 'anchorY'].forEach(p=>{
|
||||
if (params[p]!==undefined) mesh[p] = params[p];
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user