mirror of
https://gitee.com/dgflash/oops-framework.git
synced 2026-09-03 02:23:47 +08:00
删除老版框架模板
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
[InternetShortcut]
|
||||
URL=https://docs.cocos.com/creator/manual/en/scripting/setup.html#custom-script-template
|
||||
@@ -1,25 +0,0 @@
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
|
||||
/** <%Name%> 模块 */
|
||||
@ecs.register(`<%Name%>`)
|
||||
export class <%Name%> extends ecs.Entity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// <%Name%>Model!: <%Name%>ModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// <%Name%>Bll!: <%Name%>BllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
// <%Name%>View!: <%Name%>ViewComp;
|
||||
|
||||
/** 初始添加的数据层组件 */
|
||||
protected init() {
|
||||
// this.addComponents<ecs.Comp>();
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
|
||||
/** 业务层对象 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%>Comp extends ecs.Comp {
|
||||
/** 业务层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 业务层业务逻辑处理对象 */
|
||||
@ecs.register('实体对象名')
|
||||
export class <%Name%>System extends ecs.ComblockSystem implements ecs.IEntityEnterSystem {
|
||||
filter(): ecs.IMatcher {
|
||||
return ecs.allOf(<%Name%>Comp);
|
||||
}
|
||||
|
||||
entityEnter(e: ecs.Entity): void {
|
||||
// 注:自定义业务逻辑
|
||||
|
||||
|
||||
e.remove(<%Name%>Comp);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { VM } from "db://oops-framework/libs/model-view/ViewModel";
|
||||
|
||||
/** 数据层对象 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%>Comp extends ecs.Comp {
|
||||
/** 提供 MVVM 组件使用的数据 */
|
||||
private vm: any = {};
|
||||
|
||||
/** 显示数据添加到 MVVM 框架中监视 */
|
||||
vmAdd() {
|
||||
VM.add(this.vm, "<%Name%>");
|
||||
}
|
||||
|
||||
/** 显示数据从 MVVM 框架中移除 */
|
||||
vmRemove() {
|
||||
VM.remove("<%Name%>");
|
||||
}
|
||||
|
||||
/** 数据层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
for (let key in this.vm) {
|
||||
delete this.vm[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import { JsonUtil } from "db://oops-framework/core/utils/JsonUtil";
|
||||
|
||||
/** 策划 Excel 导出的 Json 静态数据 */
|
||||
export class <%Name%> {
|
||||
static TableName: string = "配置表文件名";
|
||||
|
||||
/** 静态表中一条数据 */
|
||||
private data: any;
|
||||
|
||||
init(id: number) {
|
||||
const table = JsonUtil.get(<%Name%>.TableName);
|
||||
this.data = table[id];
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** 数据唯一编号 */
|
||||
id: number = 0;
|
||||
|
||||
/** 数据 */
|
||||
// get test(): number {
|
||||
// return this.data.test;
|
||||
// }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { _decorator } from "cc";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCComp } from "db://oops-framework/module/common/CCComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('<%Name%>Comp')
|
||||
@ecs.register('<%Name%>', false)
|
||||
export class <%Name%>Comp extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import { _decorator } from "cc";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCVMParentComp } from "db://oops-framework/module/common/CCVMParentComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 - 支持 MVVM 框架的数据绑定 */
|
||||
@ccclass('<%Name%>Comp')
|
||||
@ecs.register('<%Name%>', false)
|
||||
export class <%Name%>Comp extends CCVMParentComp {
|
||||
/** 脚本控制的界面 MVVM 框架绑定数据 */
|
||||
data: any = {};
|
||||
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"image":{"type":"sprite-frame"}}
|
||||
Reference in New Issue
Block a user