dd
This commit is contained in:
@@ -40,6 +40,10 @@ export class CardControllerComp extends CCComp {
|
||||
smc.vm_data.gold.min -= smc.vm_data.cards.up_cost;
|
||||
smc.vm_data.cards.level += 1;
|
||||
smc.vm_data.cards.up_cost += 2
|
||||
if(smc.vm_data.cards.level >= smc.vm_data.cards.level_max){
|
||||
smc.vm_data.cards.level = smc.vm_data.cards.level_max;
|
||||
smc.vm_data.cards.up_cost = 11
|
||||
}
|
||||
console.log("card _level:"+this.card_level+"cost:"+smc.vm_data.cards.up_cost)
|
||||
}else{
|
||||
oops.gui.toast("金币不够");
|
||||
|
||||
28
assets/script/game/map/HeroList.ts
Normal file
28
assets/script/game/map/HeroList.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
|
||||
/** 策划 Excel 导出的 Json 静态数据 */
|
||||
export class HeroList {
|
||||
static TableName: string = "config/game/heros";
|
||||
|
||||
/** 静态表中一条数据 */
|
||||
private data: any;
|
||||
|
||||
init() {
|
||||
var table = oops.res.get(HeroList.TableName);
|
||||
this.data = table['json']['list'];
|
||||
|
||||
}
|
||||
|
||||
/** 数据唯一编号 */
|
||||
id: number = 0;
|
||||
|
||||
/** 数据 */
|
||||
get list(): number {
|
||||
let res:any = []
|
||||
for(let i=0;i<this.data.length;i++)
|
||||
{
|
||||
res[this.data[i].uuid] = this.data[i];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
9
assets/script/game/map/HeroList.ts.meta
Normal file
9
assets/script/game/map/HeroList.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "96c600ef-79ab-4952-a5c8-a3bbc7a7d15f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { v3, Vec3, _decorator ,Prefab,instantiate} from "cc";
|
||||
import { v3, Vec3, _decorator ,Prefab,instantiate,JsonAsset} 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";
|
||||
@@ -11,29 +11,27 @@ import { MapViewScene } from "./MapViewScene";
|
||||
import { Timer } from "../../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { CardSet } from "../../common/config/CardSet";
|
||||
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MapViewComp')
|
||||
@ecs.register('MapView', false)
|
||||
export class MapViewComp extends CCComp {
|
||||
scene: MapViewScene = null!;
|
||||
|
||||
/** 是否正在转场 */
|
||||
|
||||
|
||||
/** 当前地图数据 */
|
||||
current_map: any;
|
||||
/** 转场碰撞点对象集合 */
|
||||
private game_timer: Timer = new Timer(1);
|
||||
private monster_refresh_rtimer: Timer = new Timer(3);
|
||||
|
||||
|
||||
|
||||
private mapLoaded() {
|
||||
|
||||
}
|
||||
onLoad(){
|
||||
async onLoad(){
|
||||
// 监听全局事件
|
||||
oops.message.on("do_add_monster", this.on_do_add_monster, this);
|
||||
oops.message.on("do_add_hero", this.on_do_add_hero, this);
|
||||
|
||||
}
|
||||
private on_do_add_monster(event: string, args: any) {
|
||||
this.addMonster()
|
||||
@@ -49,9 +47,12 @@ export class MapViewComp extends CCComp {
|
||||
|
||||
start() {
|
||||
this.scene = this.getComponent(MapViewScene);
|
||||
|
||||
this.load_data()
|
||||
}
|
||||
load_data(){
|
||||
// let heros = oops.res.get("config/game/heros")
|
||||
// console.log("heros",heros)
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
if (this.monster_refresh_rtimer.update(dt)) {
|
||||
this.monster_refresh()
|
||||
|
||||
Reference in New Issue
Block a user