proper linked and loading flags
parent
e361382580
commit
16a48cbac7
|
@ -54,14 +54,14 @@ GameLib.Component = function(
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build ID to object should run through all sub components -
|
* Build ID to object should run through all sub components -
|
||||||
* if one is found which is not loaded, this component is not loaded fully
|
* if one is found which is not linked, this component is not linked fully
|
||||||
*/
|
*/
|
||||||
this.buildIdToObject();
|
this.buildIdToObject();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Don't try to create an instance of this object until it is fully loaded
|
* Don't try to create an instance of this object until it is fully linked
|
||||||
*/
|
*/
|
||||||
if (this.loaded) {
|
if (this.linked) {
|
||||||
try {
|
try {
|
||||||
this.createInstance();
|
this.createInstance();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -89,6 +89,9 @@ GameLib.Component.prototype.createInstance = function() {
|
||||||
console.log('create instance : '+ this.name);
|
console.log('create instance : '+ this.name);
|
||||||
|
|
||||||
if (this.instance) {
|
if (this.instance) {
|
||||||
|
|
||||||
|
this.loaded = true;
|
||||||
|
|
||||||
GameLib.Event.EmitInstanceEvents(this);
|
GameLib.Event.EmitInstanceEvents(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -477,14 +477,8 @@ GameLib.System.Linking.prototype.componentCreated = function(data) {
|
||||||
/**
|
/**
|
||||||
* Resolve any dependencies to this component
|
* Resolve any dependencies to this component
|
||||||
*/
|
*/
|
||||||
var resolved = this.resolveDependencies(component);
|
this.resolveDependencies(component);
|
||||||
|
|
||||||
if (resolved) {
|
|
||||||
/**
|
|
||||||
* Some dependencies were resolved - we should check our list of other components with unresolved dependencies
|
|
||||||
* and try to resolve them
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue