failsafe scene instance creation, logs for systems
parent
927449516c
commit
9d82f9830c
|
@ -157,13 +157,21 @@ GameLib.D3.Scene.prototype.createInstance = function() {
|
|||
|
||||
this.meshes.map(
|
||||
function(mesh) {
|
||||
instance.add(mesh.instance);
|
||||
if (mesh && mesh.instance) {
|
||||
instance.add(mesh.instance);
|
||||
} else {
|
||||
console.warn('invalid mesh at point of scene create instance');
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
this.lights.map(
|
||||
function(light) {
|
||||
instance.add(light.instance);
|
||||
if (light && light.instance) {
|
||||
instance.add(light.instance);
|
||||
} else {
|
||||
console.warn('invalid light at point of scene create instance');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ GameLib.System.prototype.start = function() {
|
|||
|
||||
this.started = true;
|
||||
|
||||
console.log('starting ' + this.name);
|
||||
|
||||
// if (this.systemType === GameLib.System.SYSTEM_TYPE_ANIMATION) {
|
||||
// // this.pathFollowingObjects = GameLib.EntityManager.Instance.query([GameLib.D3.PathFollowing]);
|
||||
|
@ -134,6 +135,8 @@ GameLib.System.prototype.stop = function() {
|
|||
|
||||
this.started = false;
|
||||
|
||||
console.log('stopping ' + this.name);
|
||||
|
||||
//
|
||||
// if (this.systemType === GameLib.System.SYSTEM_TYPE_ANIMATION) {
|
||||
// // this.pathFollowingObjects = [];
|
||||
|
|
|
@ -470,7 +470,7 @@ GameLib.System.Storage.prototype.loadComponent = function(apiUrl, toProcess, inc
|
|||
|
||||
if (!runtimeComponent) {
|
||||
if (clientErrorCallback) {
|
||||
clientErrorCallback('Could not create a runtime component: ' + component.name);
|
||||
clientErrorCallback({result : 'failure', message : 'Could not create a runtime component: ' + component.name});
|
||||
}
|
||||
//throw new Error('Could not create a runtime component: ' + component.name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue