refactor(hero): 优化英雄缩放逻辑和位置配置

重构英雄缩放逻辑,使用统一的缩放计算方法替代硬编码值
调整英雄和怪物的初始位置坐标
在Hero和Monster类中添加size变量控制缩放
This commit is contained in:
2025-11-04 10:38:20 +08:00
parent ed1b4f46a4
commit 5c9f299fd7
6 changed files with 55 additions and 38 deletions

View File

@@ -81,8 +81,8 @@ export class HeroViewComp extends CCComp {
this.initUINodes();
/** 方向 */
this.node.setScale(this.scale,1);
this.top_node.setScale(this.scale,1);
this.node.setScale(this.scale*this.node.scale.x,1*this.node.scale.y);
this.top_node.setScale(this.scale*this.top_node.scale.x,1*this.top_node.scale.y);
// if(this.model && this.model.is_boss){
// this.top_node.position=v3(this.node.position.x,this.node.position.y+70,0)
// }