技能继续
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { _decorator } 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 { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -9,19 +10,30 @@ const { ccclass, property } = _decorator;
|
||||
@ecs.register('MSCardComp', false)
|
||||
export class MSCardComp extends CCComp {
|
||||
s_uuid: number = 0;
|
||||
is_updated: boolean = false;
|
||||
is_update: boolean = false;
|
||||
is_select: boolean = false;
|
||||
is_selected: boolean = false;
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
console.log("MSCardComp start");
|
||||
if(this.is_updated){ this.node.getChildByName("update").active=true }else{ this.node.getChildByName("update").active=false }
|
||||
if(this.is_select){ this.node.getChildByName("select").active=true }else{ this.node.getChildByName("select").active=false }
|
||||
if(this.is_selected){ this.node.getChildByName("selected").active=true }else{ this.node.getChildByName("selected").active=false }
|
||||
if(this.is_update){
|
||||
this.node.getChildByName("update").active=true
|
||||
}else{
|
||||
this.node.getChildByName("update").active=false
|
||||
}
|
||||
if(this.is_select){
|
||||
this.node.getChildByName("set").active=true
|
||||
this.update_select()
|
||||
}else{
|
||||
this.node.getChildByName("set").active=false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
update_select(){
|
||||
if(smc.mskill ==this.s_uuid){ this.node.getChildByName("btn").active=false }else{ this.node.getChildByName("btn").active=true }
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user