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