|
@@ -2,7 +2,7 @@
|
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
* @Author: mojunshou 1637302775@qq.com
|
|
|
* @Date: 2025-03-20 15:01:09
|
|
* @Date: 2025-03-20 15:01:09
|
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
* @LastEditors: mojunshou 1637302775@qq.com
|
|
|
- * @LastEditTime: 2025-04-02 11:46:35
|
|
|
|
|
|
|
+ * @LastEditTime: 2025-04-02 15:57:03
|
|
|
* @Description: 消除游戏主场景
|
|
* @Description: 消除游戏主场景
|
|
|
*/
|
|
*/
|
|
|
import { _decorator, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, Toggle, tween, UITransform, Vec2, Vec3, Widget } from "cc";
|
|
import { _decorator, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, Toggle, tween, UITransform, Vec2, Vec3, Widget } from "cc";
|
|
@@ -109,6 +109,16 @@ export class EliminateViewComp extends CCComp {
|
|
|
private redPacketPrefab: Prefab = null!;
|
|
private redPacketPrefab: Prefab = null!;
|
|
|
@property({ type: Label, displayName: "本局分数" })
|
|
@property({ type: Label, displayName: "本局分数" })
|
|
|
private lab_score: Label = null!;
|
|
private lab_score: Label = null!;
|
|
|
|
|
+ @property({ type: Label, displayName: "目标分数" })
|
|
|
|
|
+ private lab_taget: Label = null!;
|
|
|
|
|
+ @property({ type: Label, displayName: "第几块金砖" })
|
|
|
|
|
+ private lab_brick: Label = null!;
|
|
|
|
|
+
|
|
|
|
|
+ @property({ type: Label, displayName: "第几关" })
|
|
|
|
|
+ private lab_levle: Label = null!;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@property({ type: Prefab, displayName: "item预制体列表" })
|
|
@property({ type: Prefab, displayName: "item预制体列表" })
|
|
|
private itemPrefabs: Prefab[] = [];
|
|
private itemPrefabs: Prefab[] = [];
|
|
|
@property({ type: Node, displayName: "网格Node" })
|
|
@property({ type: Node, displayName: "网格Node" })
|
|
@@ -205,7 +215,6 @@ export class EliminateViewComp extends CCComp {
|
|
|
async start() {
|
|
async start() {
|
|
|
// const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
|
// const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
|
|
this.setButton();
|
|
this.setButton();
|
|
|
- this.initComponents();
|
|
|
|
|
this.initButtonState(false);
|
|
this.initButtonState(false);
|
|
|
await this.loadConfig();
|
|
await this.loadConfig();
|
|
|
this.initGrid();
|
|
this.initGrid();
|
|
@@ -218,9 +227,6 @@ export class EliminateViewComp extends CCComp {
|
|
|
oops.message.on(GameEvent.RestartGame, this.restartGame, this);
|
|
oops.message.on(GameEvent.RestartGame, this.restartGame, this);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private initComponents() {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//初始化网格
|
|
//初始化网格
|
|
@@ -244,6 +250,7 @@ export class EliminateViewComp extends CCComp {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
//初始化数据
|
|
//初始化数据
|
|
|
private initData() {
|
|
private initData() {
|
|
|
// this.gameMode = GameMode.MANUAL;
|
|
// this.gameMode = GameMode.MANUAL;
|
|
@@ -259,6 +266,17 @@ export class EliminateViewComp extends CCComp {
|
|
|
this.awardLb.string = this.cash.toString();
|
|
this.awardLb.string = this.cash.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //初始化关卡信息
|
|
|
|
|
+ private initLevelInfo() {
|
|
|
|
|
+ //关卡通关服务器或者本地读出来
|
|
|
|
|
+ // const level =
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//初始化网格
|
|
//初始化网格
|
|
|
private async loadConfig() {
|
|
private async loadConfig() {
|
|
|
let json_name: string = "gui/eliminate/config/GridConfig";
|
|
let json_name: string = "gui/eliminate/config/GridConfig";
|