protected override void onDestroy() { base.onDestroy(); if (this._hero != null) { _hero.removeEventListener(ActorMoveEventX.NEXT_STEP, stepHandle); _hero.removeEventListener(ActorMoveEventX.REACHED, stepHandle); _hero = null; } }
public virtual void refreashHero(AbstractBaseObject baseObject) { if (this._hero != null) { _hero.removeEventListener(ActorMoveEventX.NEXT_STEP, stepHandle); _hero.removeEventListener(ActorMoveEventX.REACHED, stepHandle); //_hero.removeEventListener(ActorMoveEventX.ANIMATOR_MOVE, stepHandle); //_hero.removeEventListener(ActorMoveEventX.TICK, stepHandle); } this._hero = baseObject; if (this._hero != null) { _hero.addEventListener(ActorMoveEventX.NEXT_STEP, stepHandle); _hero.addEventListener(ActorMoveEventX.REACHED, stepHandle); //_hero.addEventListener(ActorMoveEventX.ANIMATOR_MOVE, stepHandle); //_hero.addEventListener(ActorMoveEventX.TICK, stepHandle); } }
public virtual void setFollow(AbstractBaseObject value, bool forceChange = false) { if (value) { this._followBaseObject = value; this.followObject = value.gameObject; } else { this._followBaseObject = null; this.followObject = null; } if (forceChange) { updateTransform(1.0f, 1.0f); } AbstractApp.rectTriggerManager.refreashHero(value); }