refactor(hero): 统一角色状态初始化逻辑并调整UI布局
1. 将HeroSpine和HeroViewComp的默认状态从"idle"改为空字符串 2. 替换HeroViewComp中直接调用as.idle()为status_change方法 3. 调整role_controller预制体的UI元素位置和尺寸,适配240宽度布局
This commit is contained in:
@@ -31,7 +31,7 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
// ==================== View 层属性(表现相关)====================
|
||||
as: HeroSpine = null!
|
||||
status:String = "idle"
|
||||
status:String = ""
|
||||
scale: number = 1; // 显示方向
|
||||
box_group:number = BoxSet.HERO; // 碰撞组
|
||||
realDeadTime:number=0.1
|
||||
@@ -104,10 +104,10 @@ export class HeroViewComp extends CCComp {
|
||||
|
||||
/** 初始化/重置视图状态 */
|
||||
init() {
|
||||
this.status = "idle";
|
||||
this.status = "";
|
||||
this.deadCD = 0;
|
||||
this.lastBarUpdateTime = 0;
|
||||
this.as.idle()
|
||||
this.status_change("idle");
|
||||
|
||||
// 初始化 UI 节点
|
||||
this.initUINodes();
|
||||
|
||||
Reference in New Issue
Block a user