dd
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-04 15:46:16
|
||||
*/
|
||||
|
||||
import { VM } from "../../../../extensions/oops-plugin-framework/assets/libs/model-view/ViewModel";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { Initialize } from "../initialize/Initialize";
|
||||
import { GameMap } from "../map/GameMap";
|
||||
import { Role } from "../role/Role";
|
||||
import { data } from "../data/data";
|
||||
// import { data } from "../data/data";
|
||||
/** 游戏模块 */
|
||||
@ecs.register('SingletonModule')
|
||||
export class SingletonModuleComp extends ecs.Comp {
|
||||
@@ -20,7 +20,7 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
/** 游戏主角 */
|
||||
own: Role = null;
|
||||
/** 游戏数据 */
|
||||
data:data = null!;
|
||||
// data:data = null!;
|
||||
/**怪物数据 数组 */
|
||||
monsters = []
|
||||
/**heros 数据 */
|
||||
@@ -29,8 +29,28 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
heros_in = []
|
||||
monsters_dead = []
|
||||
heros_dead = []
|
||||
|
||||
reset() { }
|
||||
vm_data: any = {
|
||||
name : "数据测试",
|
||||
/** 当前等级 */
|
||||
porwer: 0,
|
||||
/** 当前经验 */
|
||||
def : 0,
|
||||
/** 下级经验 */
|
||||
speed : 0,
|
||||
hp: {
|
||||
min:50,
|
||||
max:100
|
||||
}
|
||||
};
|
||||
vmAdd() {
|
||||
console.log("dataModelComp vmAdd");
|
||||
VM.add(this.vm_data, "data");
|
||||
}
|
||||
reset() {
|
||||
for (var key in this.vm_data) {
|
||||
delete this.vm_data[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export var smc: SingletonModuleComp = ecs.getSingleton(SingletonModuleComp);
|
||||
Reference in New Issue
Block a user