delayed controls for edit
parent
aa574574a6
commit
c765a5a0d8
|
@ -34,12 +34,16 @@ GameLib.D3.Controls = function (
|
|||
domElement : GameLib.DomElement
|
||||
};
|
||||
|
||||
var delayed = false;
|
||||
|
||||
if (this.controlsType === GameLib.D3.Controls.CONTROLS_TYPE_EDITOR) {
|
||||
|
||||
componentType = GameLib.Component.COMPONENT_CONTROLS_EDITOR;
|
||||
|
||||
linkedObjects.raycaster = GameLib.D3.Raycaster;
|
||||
linkedObjects.camera = GameLib.D3.Camera;
|
||||
|
||||
delayed = true;
|
||||
}
|
||||
|
||||
if (this.controlsType === GameLib.D3.Controls.CONTROLS_TYPE_TOUCH) {
|
||||
|
@ -57,7 +61,8 @@ GameLib.D3.Controls = function (
|
|||
GameLib.Component.call(
|
||||
this,
|
||||
componentType,
|
||||
linkedObjects
|
||||
linkedObjects,
|
||||
delayed
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -59,13 +59,6 @@ GameLib.D3.Controls.Editor.prototype.constructor = GameLib.D3.Controls.Editor;
|
|||
* @returns {THREE.EditorControls}
|
||||
*/
|
||||
GameLib.D3.Controls.Editor.prototype.createInstance = function() {
|
||||
console.log('delaying controls instance creation - call GameLib.D3.Controls.Editor.delayedInstance() to create the instance');
|
||||
GameLib.D3.Controls.prototype.createInstance.call(this);
|
||||
};
|
||||
|
||||
GameLib.D3.Controls.Editor.prototype.delayedInstance = function() {
|
||||
|
||||
console.log('GameLib.D3.Controls.Editor.delayedInstance() called');
|
||||
|
||||
if (!this.camera || !this.camera.instance) {
|
||||
throw new Error('No camera at time of instance');
|
||||
|
@ -79,6 +72,8 @@ GameLib.D3.Controls.Editor.prototype.delayedInstance = function() {
|
|||
this.camera.instance,
|
||||
this.domElement.instance
|
||||
);
|
||||
|
||||
GameLib.D3.Controls.prototype.createInstance.call(this);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -88,13 +83,6 @@ GameLib.D3.Controls.Editor.prototype.updateInstance = function() {
|
|||
|
||||
console.warn('an update instance was called on editor controls - which, if not called from within a running system at the right time will affect the order of input event handling and cause system instability');
|
||||
|
||||
// if (this.instance) {
|
||||
// this.instance.dispose();
|
||||
// delete this.instance;
|
||||
// }
|
||||
//
|
||||
// this.delayedInstance();
|
||||
|
||||
GameLib.D3.Controls.prototype.updateInstance.call(this);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue