failsafe scene instance creation, logs for systems

beta.r3js.org
-=yb4f310 2017-10-22 13:13:06 +02:00
parent 927449516c
commit 9d82f9830c
3 changed files with 14 additions and 3 deletions

View File

@ -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');
}
}
);

View File

@ -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 = [];

View File

@ -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);
}