UNPKG

laya-coreui-es

Version:

laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改

51 lines (50 loc) 1.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EffectBase = void 0; const Handler_1 = require("../utils/Handler"); const Component_1 = require("../components/Component"); class EffectBase extends Component_1.Component { constructor() { super(...arguments); this.duration = 1000; this.delay = 0; this.repeat = 0; this.autoDestroyAtComplete = true; } _onAwake() { this.target = this.target || this.owner; if (this.autoDestroyAtComplete) this._comlete = Handler_1.Handler.create(this.target, this.target.destroy, null, false); if (this.eventName) this.owner.on(this.eventName, this, this._exeTween); else this._exeTween(); } _exeTween() { this._tween = this._doTween(); this._tween.repeat = this.repeat; } _doTween() { return null; } onReset() { this.duration = 1000; this.delay = 0; this.repeat = 0; this.ease = null; this.target = null; if (this.eventName) { this.owner.off(this.eventName, this, this._exeTween); this.eventName = null; } if (this._comlete) { this._comlete.recover(); this._comlete = null; } if (this._tween) { this._tween.clear(); this._tween = null; } } } exports.EffectBase = EffectBase;