parentCanvas update instance
parent
c064185fd4
commit
a8c8ef507d
|
@ -222,6 +222,10 @@ GameLib.D3.Light.prototype.updateInstance = function(property) {
|
||||||
if (property === 'color') {
|
if (property === 'color') {
|
||||||
this.instance.color.set(this.color.toHex());
|
this.instance.color.set(this.color.toHex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'parentScene' is handled by LinkingSystem
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -623,6 +623,10 @@ GameLib.D3.Mesh.prototype.updateInstance = function(property) {
|
||||||
this.createHelper();
|
this.createHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 'parentScene' is handled by LinkingSystem
|
||||||
|
*/
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -74,6 +74,26 @@ GameLib.D3.Text.prototype.updateInstance = function(property) {
|
||||||
this.parentCanvas.updateInstance('texts');
|
this.parentCanvas.updateInstance('texts');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (property === 'parentCanvas') {
|
||||||
|
|
||||||
|
GameLib.EntityManager.Instance.queryComponents(GameLib.Component.CANVAS).map(
|
||||||
|
function(canvas) {
|
||||||
|
|
||||||
|
var index = canvas.texts.indexOf(this);
|
||||||
|
|
||||||
|
if (index !== -1) {
|
||||||
|
canvas.texts.splice(index, 1);
|
||||||
|
canvas.texts.updateInstance('texts');
|
||||||
|
}
|
||||||
|
}.bind(this)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this.parentCanvas) {
|
||||||
|
GameLib.Utils.PushUnique(this.parentCanvas.texts, this);
|
||||||
|
this.parentCanvas.updateInstance('texts');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -488,6 +488,7 @@ GameLib.System.GUI.prototype.buildParentSelectionControl = function(folder, comp
|
||||||
function(component) {
|
function(component) {
|
||||||
|
|
||||||
component[property] = newComponent;
|
component[property] = newComponent;
|
||||||
|
component.updateInstance(property);
|
||||||
|
|
||||||
if (property === 'parentEntity') {
|
if (property === 'parentEntity') {
|
||||||
GameLib.Event.Emit(
|
GameLib.Event.Emit(
|
||||||
|
|
|
@ -787,7 +787,6 @@ GameLib.System.Linking.prototype.onParentWorldChange = function(data) {
|
||||||
data.object instanceof GameLib.D3.RigidBody
|
data.object instanceof GameLib.D3.RigidBody
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
if (data.originalWorld instanceof GameLib.D3.PhysicsWorld) {
|
if (data.originalWorld instanceof GameLib.D3.PhysicsWorld) {
|
||||||
data.originalWorld.removeRigidBody(data.object);
|
data.originalWorld.removeRigidBody(data.object);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue