diff --git a/src/game-lib-a-component-a.js b/src/game-lib-a-component-a.js index 5214825..bd02d07 100644 --- a/src/game-lib-a-component-a.js +++ b/src/game-lib-a-component-a.js @@ -54,14 +54,14 @@ GameLib.Component = function( /** * 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(); /** - * 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 { this.createInstance(); } catch (error) { @@ -89,6 +89,9 @@ GameLib.Component.prototype.createInstance = function() { console.log('create instance : '+ this.name); if (this.instance) { + + this.loaded = true; + GameLib.Event.EmitInstanceEvents(this); } diff --git a/src/game-lib-system-linking.js b/src/game-lib-system-linking.js index c00cdc3..cbaf3ac 100644 --- a/src/game-lib-system-linking.js +++ b/src/game-lib-system-linking.js @@ -477,14 +477,8 @@ GameLib.System.Linking.prototype.componentCreated = function(data) { /** * 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 - */ - } };