refactor(组件): 添加组件销毁时的资源清理逻辑并移除无用文件
在TopComp、move和HeroAnmComp组件中添加onDestroy方法,用于清理事件监听 移除已不再使用的MInfoComp组件及其meta文件
This commit is contained in:
@@ -37,6 +37,12 @@ export class move extends Component {
|
||||
this.setInitialPosition()
|
||||
}
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
oops.message.off(GameEvent.MAP_MOVE_END_LEFT, this.onMapMoveEndLeft, this);
|
||||
oops.message.off(GameEvent.MAP_MOVE_END_RIGHT, this.onMapMoveEndRight, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据移动方向设置初始位置
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user