- 调整角色控制器Prefab中节点的组件ID引用 - 修正部分节点的激活状态与位置信息 - 更新按钮组件及点击事件绑定,改进英雄购买交互逻辑 - 替换文本标签组件,新增字体样式与阴影效果提升可读性 - 增加背景与装饰组件,优化界面视觉层次与布局 - 调整图片资源引用,修改部分Sprite颜色及灰度设置 - 优化UITransform组件配置,调整节点尺寸与锚点位置 - 引入新的Widget组件,完善布局自适应能力 - 增加输入事件阻断组件,防止界面误触操作 - 整体提升界面元素结构清晰度与交互体验一致性
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import { _decorator, instantiate, Prefab, resources, Sprite, SpriteAtlas, UITransform } from "cc";
|
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
|
import { smc } from "../common/SingletonModuleComp";
|
|
import { GameEvent } from "../common/config/GameEvent";
|
|
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
/** 视图层对象 */
|
|
@ccclass('MissionHomeComp')
|
|
@ecs.register('MissionHome', false)
|
|
export class MissionHomeComp extends CCComp {
|
|
protected onLoad(): void {
|
|
this.on(GameEvent.MissionEnd,this.mission_end,this)
|
|
}
|
|
/** 视图层逻辑代码分离演示 */
|
|
start() {
|
|
this.home_active()
|
|
}
|
|
onEnable(){
|
|
}
|
|
update(dt:number){
|
|
|
|
}
|
|
|
|
|
|
|
|
mission_end(){
|
|
console.log("[MissionHomeComp]=>mission_end")
|
|
this.home_active()
|
|
}
|
|
home_active(){
|
|
this.uodate_data()
|
|
this.node.active=true
|
|
|
|
}
|
|
uodate_data(){
|
|
|
|
}
|
|
isWxClient(){
|
|
return typeof wx !== 'undefined' && typeof (wx as any).getSystemInfoSync === 'function';
|
|
}
|
|
btn_func(e:string,data:any){
|
|
|
|
}
|
|
|
|
|
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
|
reset() {
|
|
this.node.destroy();
|
|
}
|
|
} |