This commit is contained in:
2024-08-13 17:06:10 +08:00
parent 825457fd0e
commit 876a56c8c1
17 changed files with 2156 additions and 610 deletions

View File

@@ -10,9 +10,9 @@ import { CardList } from "../common/config/CardSet";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('ControllerComp')
@ecs.register('Controller', false)
export class ControllerComp extends CCComp {
@ccclass('CardControllerComp')
@ecs.register('CardController', false)
export class CardControllerComp extends CCComp {
card_level = 1;
start() {
this.load_cards()

View File

@@ -1,29 +0,0 @@
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";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('CardControllerComp')
@ecs.register('CardController', false)
export class CardControllerComp extends CCComp {
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
}
}

View File

@@ -0,0 +1,73 @@
import { _decorator,NodeEventType,EventTouch } 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 { UIID } from "../common/config/GameUIConfig";
import { smc } from "../common/SingletonModuleComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('CsuoComp')
@ecs.register('Csuo', false)
export class CsuoComp extends CCComp {
protected onLoad() {
// this.node.on(NodeEventType.TOUCH_START, this.onTouch, this);
}
onTouch() {
oops.gui.open(
UIID.Window,
{
'title':'解锁',
'content':'解锁解锁解锁解锁解锁解锁解锁解锁解锁解锁解锁解锁',
'okWord':'ok',
'okFunc':this.onOk(),
'cancelWord':'解锁',
'cancelFunc':this.oncancel(),
'needCancel':true
}
)
}
onOk(){
}
oncancel(){
smc.vm_data.power.min=smc.vm_data.power.min+1;
this.node.active=false;
}
/**
*
*
* @param params 参数
* {
* title: 标题
* content: 内容
* okWord: ok按钮上的文字
* okFunc: 确认时执行的方法
* cancelWord: 取消按钮的文字
* cancelFunc: 取消时执行的方法
* needCancel: 是否需要取消按钮
* }
*/
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
}
}

View File

@@ -2,7 +2,7 @@
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7c495718-13bc-4f64-8ecc-27c210626d0a",
"uuid": "bcd8a069-5208-4be1-8c8e-2cedddb3860a",
"files": [],
"subMetas": {},
"userData": {}