Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/framework/components/button/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ButtonComponentSystem extends ComponentSystem {

this.ComponentType = ButtonComponent;

this.on('beforeremove', this._onRemoveComponent, this);
this.on('beforeremove', this.onBeforeRemove, this);

this.app.systems.on('update', this.onUpdate, this);
}
Expand Down Expand Up @@ -87,7 +87,7 @@ class ButtonComponentSystem extends ComponentSystem {
}
}

_onRemoveComponent(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}

Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/element/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ElementComponentSystem extends ComponentSystem {
this.defaultImageMaterials = [];

this.on('add', this.onAddComponent, this);
this.on('beforeremove', this.onRemoveComponent, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

destroy() {
Expand Down Expand Up @@ -268,7 +268,7 @@ class ElementComponentSystem extends ComponentSystem {
entity.fire('element:add');
}

onRemoveComponent(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}

Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/gsplat/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class GSplatComponentSystem extends ComponentSystem {
ShaderChunks.get(app.graphicsDevice, SHADERLANGUAGE_GLSL).add(gsplatChunksGLSL);
ShaderChunks.get(app.graphicsDevice, SHADERLANGUAGE_WGSL).add(gsplatChunksWGSL);

this.on('beforeremove', this.onRemove, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

initializeComponentData(component, _data, properties) {
Expand Down Expand Up @@ -164,7 +164,7 @@ class GSplatComponentSystem extends ComponentSystem {
return component;
}

onRemove(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}

Expand Down
1 change: 0 additions & 1 deletion src/framework/components/joint/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class JointComponentSystem extends ComponentSystem {
super(app);

this.id = 'joint';
this.app = app;

this.ComponentType = JointComponent;
}
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/layout-group/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LayoutGroupComponentSystem extends ComponentSystem {

this._reflowQueue = [];

this.on('beforeremove', this._onRemoveComponent, this);
this.on('beforeremove', this.onBeforeRemove, this);

// Perform reflow when running in the engine
this.app.systems.on('postUpdate', this._onPostUpdate, this);
Expand Down Expand Up @@ -117,7 +117,7 @@ class LayoutGroupComponentSystem extends ComponentSystem {
}
}

_onRemoveComponent(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}

Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/light/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class LightComponentSystem extends ComponentSystem {

this.ComponentType = LightComponent;

this.on('beforeremove', this._onRemoveComponent, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

initializeComponentData(component, _data) {
Expand Down Expand Up @@ -64,7 +64,7 @@ class LightComponentSystem extends ComponentSystem {
super.initializeComponentData(component, data);
}

_onRemoveComponent(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}

Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/model/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ModelComponentSystem extends ComponentSystem {

this.defaultMaterial = getDefaultMaterial(app.graphicsDevice);

this.on('beforeremove', this.onRemove, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

initializeComponentData(component, _data) {
Expand Down Expand Up @@ -146,7 +146,7 @@ class ModelComponentSystem extends ComponentSystem {
return component;
}

onRemove(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/render/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RenderComponentSystem extends ComponentSystem {

this.defaultMaterial = getDefaultMaterial(app.graphicsDevice);

this.on('beforeremove', this.onRemove, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

initializeComponentData(component, _data, properties) {
Expand Down Expand Up @@ -107,7 +107,7 @@ class RenderComponentSystem extends ComponentSystem {
return component;
}

onRemove(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/screen/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ScreenComponentSystem extends ComponentSystem {

this.app.systems.on('update', this._onUpdate, this);

this.on('beforeremove', this.onRemoveComponent, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

initializeComponentData(component, data, properties) {
Expand Down Expand Up @@ -118,7 +118,7 @@ class ScreenComponentSystem extends ComponentSystem {
});
}

onRemoveComponent(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}

Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/script/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ScriptComponentSystem extends ComponentSystem {
// if true then we are currently preloading scripts
this.preloading = true;

this.on('beforeremove', this._onBeforeRemove, this);
this.on('beforeremove', this.onBeforeRemove, this);
this.app.systems.on('initialize', this._onInitialize, this);
this.app.systems.on('postInitialize', this._onPostInitialize, this);
this.app.systems.on('update', this._onUpdate, this);
Expand Down Expand Up @@ -182,7 +182,7 @@ class ScriptComponentSystem extends ComponentSystem {
this._enabledComponents.remove(component);
}

_onBeforeRemove(entity, component) {
onBeforeRemove(entity, component) {
const ind = this._components.items.indexOf(component);
if (ind >= 0) {
component._onBeforeRemove();
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/scroll-view/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ScrollViewComponentSystem extends ComponentSystem {

this.ComponentType = ScrollViewComponent;

this.on('beforeremove', this._onRemoveComponent, this);
this.on('beforeremove', this.onBeforeRemove, this);

this.app.systems.on('update', this.onUpdate, this);
}
Expand Down Expand Up @@ -94,7 +94,7 @@ class ScrollViewComponentSystem extends ComponentSystem {
}
}

_onRemoveComponent(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}

Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/scrollbar/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ScrollbarComponentSystem extends ComponentSystem {
this.ComponentType = ScrollbarComponent;

this.on('add', this._onAddComponent, this);
this.on('beforeremove', this._onRemoveComponent, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

initializeComponentData(component, data, properties) {
Expand Down Expand Up @@ -60,7 +60,7 @@ class ScrollbarComponentSystem extends ComponentSystem {
entity.fire('scrollbar:add');
}

_onRemoveComponent(entity, component) {
onBeforeRemove(entity, component) {
component.onRemove();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/zone/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ZoneComponentSystem extends ComponentSystem {

this.ComponentType = ZoneComponent;

this.on('beforeremove', this._onBeforeRemove, this);
this.on('beforeremove', this.onBeforeRemove, this);
}

initializeComponentData(component, data, properties) {
Expand All @@ -49,7 +49,7 @@ class ZoneComponentSystem extends ComponentSystem {
return this.addComponent(clone, data);
}

_onBeforeRemove(entity, component) {
onBeforeRemove(entity, component) {
component._onBeforeRemove();
}
}
Expand Down