refactor(game): 移除未使用的数据模块和测试代码
清理不再使用的数据模块文件(data相关)和测试代码(Test.ts),优化项目结构
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
import { oops } from "db://oops-framework/core/Oops"
|
||||
|
||||
export class Test{
|
||||
load_data_from_local() {
|
||||
let local_data = this.get_local_data()
|
||||
if(!local_data.data||!local_data.fight_heros||!local_data.heros||!local_data.items||!local_data.tals||!local_data.equips){
|
||||
return this.init_local_data()
|
||||
}
|
||||
return local_data
|
||||
}
|
||||
get_local_data(){
|
||||
let local_data ={
|
||||
user_id: "local_debug",
|
||||
openid: "local_debug",
|
||||
regist_time: Date.now(),
|
||||
data: JSON.parse(oops.storage.get("data")||null),
|
||||
fight_heros: JSON.parse(oops.storage.get("fight_heros")||null),
|
||||
heros: JSON.parse(oops.storage.get("heros")||null),
|
||||
items: JSON.parse(oops.storage.get("items")||null),
|
||||
tals: JSON.parse(oops.storage.get("tals")||null),
|
||||
equips: JSON.parse(oops.storage.get("equips")||null)
|
||||
}
|
||||
return local_data
|
||||
}
|
||||
init_local_data(){
|
||||
let init_data = {
|
||||
data : { score: 0, mission: 1, gold: 100, diamond: 100, meat: 0, exp: 0,},
|
||||
fight_heros: { 0: 0, 1: 0, 2: 0, 3: 0, 4: 0 },
|
||||
heros: {
|
||||
5001: { uuid: 5001, lv: 1 },
|
||||
5005: { uuid: 5005, lv: 1 },
|
||||
5007: { uuid: 5007, lv: 1 }
|
||||
},
|
||||
items: {},
|
||||
tals: {},
|
||||
equips: {}
|
||||
}
|
||||
oops.storage.set("data", JSON.stringify(init_data.data))
|
||||
oops.storage.set("fight_heros", JSON.stringify(init_data.fight_heros))
|
||||
oops.storage.set("heros", JSON.stringify(init_data.heros))
|
||||
oops.storage.set("items", JSON.stringify(init_data.items))
|
||||
oops.storage.set("tals", JSON.stringify(init_data.tals))
|
||||
oops.storage.set("equips", JSON.stringify(init_data.equips))
|
||||
return this.get_local_data()
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "893646a7-1cf0-4c80-8fe1-39ac111130fc",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('stoast')
|
||||
export class stoast extends Component {
|
||||
|
||||
|
||||
onAdded(args: any) {
|
||||
console.log("toast打开",args)
|
||||
}
|
||||
|
||||
private close() {
|
||||
oops.gui.removeByNode(this.node);
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "d26fa84f-22b4-4136-bb46-d7e978683365",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user