dd
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { _decorator } from "cc";
|
||||
import { _decorator, Label } 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 { Talents } from "../common/config/TalentSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -8,12 +10,35 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass('TalentComp')
|
||||
@ecs.register('TalentView', false)
|
||||
export class TalentComp extends CCComp {
|
||||
t_uuid:number = 0;
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
let name =this.node.getChildByName("name")
|
||||
let info =this.node.getChildByName("info")
|
||||
let icon =this.node.getChildByName("icon")
|
||||
let cost =this.node.getChildByName("cost")
|
||||
let lv =this.node.getChildByName("lv")
|
||||
let talent= Talents[this.t_uuid]
|
||||
let role_talents = smc.vm_data.talent[talent.uuid]
|
||||
cost.getComponent(Label).string = (talent.cost*(1+role_talents.lv)).toString()
|
||||
name.getComponent(Label).string = talent.name
|
||||
info.getComponent(Label).string = talent.info
|
||||
lv.getComponent(Label).string = role_talents.lv.toString()
|
||||
if (talent.type == 1){
|
||||
this.node.getChildByName("role").active=true
|
||||
}
|
||||
|
||||
if (talent.type == 2){
|
||||
this.node.getChildByName("hero").active=true
|
||||
}
|
||||
|
||||
if (talent.type == 3){
|
||||
this.node.getChildByName("mission").active=true
|
||||
}
|
||||
}
|
||||
to_update_t(){
|
||||
console.log("to_update_t",this.t_uuid)
|
||||
}
|
||||
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
|
||||
Reference in New Issue
Block a user