Skip to content

Commit

Permalink
Dev/0.6 plus (#590)
Browse files Browse the repository at this point in the history
* fix: the bug that inputmanager cannot be obtained
  • Loading branch information
GuoLei1990 authored Nov 16, 2021
1 parent 9a30dbe commit dbd84ad
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/core/src/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class Engine extends EventDispatcher {

/** Physics manager of Engine. */
readonly physicsManager: PhysicsManager;
readonly inputManager: InputManager;

_componentsManager: ComponentsManager = new ComponentsManager();
_hardwareRenderer: IHardwareRenderer;
Expand All @@ -72,8 +73,6 @@ export class Engine extends EventDispatcher {
/** @internal */
_spriteMaskManager: SpriteMaskManager;
/** @internal */
_inputManager: InputManager;
/** @internal */
_macroCollection: ShaderMacroCollection = new ShaderMacroCollection();

protected _canvas: Canvas;
Expand Down Expand Up @@ -196,7 +195,7 @@ export class Engine extends EventDispatcher {
this._spriteDefaultMaterial = this._createSpriteMaterial();
this._spriteMaskDefaultMaterial = this._createSpriteMaskMaterial();

this._inputManager = new InputManager(this);
this.inputManager = new InputManager(this);

const whitePixel = new Uint8Array([255, 255, 255, 255]);

Expand Down Expand Up @@ -278,7 +277,7 @@ export class Engine extends EventDispatcher {
this.physicsManager._update(deltaTime / 1000.0);
componentsManager.callColliderOnLateUpdate();
}
this._inputManager._update();
this.inputManager._update();
componentsManager.callScriptOnUpdate(deltaTime);
componentsManager.callAnimationUpdate(deltaTime);
componentsManager.callScriptOnLateUpdate(deltaTime);
Expand Down Expand Up @@ -308,7 +307,7 @@ export class Engine extends EventDispatcher {
if (this._sceneManager) {
this._whiteTexture2D.destroy(true);
this._whiteTextureCube.destroy(true);
this._inputManager._destroy();
this.inputManager._destroy();
this.trigger(new Event("shutdown", this));
engineFeatureManager.callFeatureMethod(this, "shutdown", [this]);

Expand Down

0 comments on commit dbd84ad

Please sign in to comment.