refactor(组件): 添加组件销毁时的资源清理逻辑并移除无用文件
在TopComp、move和HeroAnmComp组件中添加onDestroy方法,用于清理事件监听 移除已不再使用的MInfoComp组件及其meta文件
This commit is contained in:
@@ -17,6 +17,12 @@ export default class HeroAnmComp extends Component{
|
||||
this.anmcon.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
if (this.anmcon) {
|
||||
this.anmcon.off(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stop () {
|
||||
this._hasStop = true;
|
||||
|
||||
Reference in New Issue
Block a user