fix(hero): 修复大招播放结束后未取消层级置顶的问题
1. 新增isCastingMax标记跟踪大招播放状态,在释放大招时设置该标记 2. 在动画播放结束回调中,当大招动画播放完成时清除置顶标记 3. 调整渲染排序逻辑,将大招播放中的英雄置于渲染层级最下方 4. 在角色死亡和重置时同步重置置顶标记
This commit is contained in:
@@ -41,6 +41,13 @@ export default class HeroAnmComp extends Component {
|
||||
this._hasStop = true;
|
||||
}
|
||||
onAnimationFinished(type: Animation.EventType, state: AnimationState) {
|
||||
if (state.name === "max0" || state.name === "max1") {
|
||||
// 大招播放结束,清除 HeroViewComp 的置顶标记,恢复 MoveSystem 统一排序
|
||||
const viewComp = this.node.getComponent(HeroViewComp) || this.node.getComponentInParent(HeroViewComp);
|
||||
if (viewComp) {
|
||||
viewComp.isCastingMax = false;
|
||||
}
|
||||
}
|
||||
if (state.name != "idle" && state.name != "move") {
|
||||
this.anmcon.play(this.default_anim)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user