更新游戏内 错误报警带场景值,更新锁摇晃效果

This commit is contained in:
COMPUTER\EDY 2026-01-09 16:55:48 +08:00
parent b374af2058
commit 6ba283997b
10 changed files with 108 additions and 85 deletions

View File

@ -866,6 +866,14 @@ export default class Block extends cc.Component {
return false; return false;
} }
if (this.type == BlockType.) {
if (this.node.getChildByName("lock")) {
let lock = this.node.getChildByName("lock").getChildByName("icon");
lock.stopAllActions();
lock.rotation = 0;
lock.runAction(cc.sequence(cc.rotateTo(0.1, -10), cc.rotateTo(0.2, 10), cc.rotateTo(0.2, -10), cc.rotateTo(0.1, 0)));
}
}
if (this.type != BlockType. && this.type != BlockType. && this.type != BlockType.) { if (this.type != BlockType. && this.type != BlockType. && this.type != BlockType.) {
MapConroler._instance.startUpdate(); MapConroler._instance.startUpdate();
if (this.type == BlockType.) if (this.type == BlockType.)

View File

@ -61,6 +61,7 @@ export default class GameManager extends cc.Component {
// }); // });
this.startTimeCutDown(); this.startTimeCutDown();
cc.fx.GameConfig.init(true); cc.fx.GameConfig.init(true);
cc.fx.GameConfig.GM_INFO.sceneValue = "loadScene";
cc.fx.GameConfig.GM_INFO.gameState = false; cc.fx.GameConfig.GM_INFO.gameState = false;
setTimeout(() => { setTimeout(() => {
cc.fx.GameTool.initWechatErrorTracking(); cc.fx.GameTool.initWechatErrorTracking();

View File

@ -119,6 +119,7 @@ export default class JiaZai extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.otherUid != "") { if (cc.fx.GameConfig.GM_INFO.otherUid != "") {
this.getShareInfo(); this.getShareInfo();
} }
cc.fx.GameConfig.GM_INFO.sceneValue = "HomeScene";
initProvinceLocator(); initProvinceLocator();
// this.RankNode = null; // this.RankNode = null;
this.isShow = true; this.isShow = true;

View File

@ -193,7 +193,7 @@ export default class MapConroler extends cc.Component {
// cc.fx.GameConfig.GM_INFO.level += 1; // cc.fx.GameConfig.GM_INFO.level += 1;
// cc.fx.GameConfig.LEVEL_INFO_init(true, 0, false); // cc.fx.GameConfig.LEVEL_INFO_init(true, 0, false);
// }, 1000); // }, 1000);
cc.fx.GameConfig.GM_INFO.sceneValue = "GameScene";
MiniGameSdk.API.setNewCloudlevel(); MiniGameSdk.API.setNewCloudlevel();
cc.fx.GameConfig.GM_INFO.review = 0; cc.fx.GameConfig.GM_INFO.review = 0;

View File

@ -141,6 +141,7 @@ export class GameConfig {
firstTime: number; //用户注册时间 firstTime: number; //用户注册时间
longitude: string; //用户经度 longitude: string; //用户经度
cityRank: number; //城市排名 cityRank: number; //城市排名
sceneValue: string; //当前场景值
shopDouble: { gold_1: boolean; gold_2: boolean; gold_3: boolean; gold_4: boolean; gold_5: boolean; gold_6: boolean; }; shopDouble: { gold_1: boolean; gold_2: boolean; gold_3: boolean; gold_4: boolean; gold_5: boolean; gold_6: boolean; };
}; };
@ -157,6 +158,7 @@ export class GameConfig {
//游戏内信息 //游戏内信息
static get Instance() { static get Instance() {
@ -326,6 +328,7 @@ export class GameConfig {
firstTime: 0, //用户注册时间 firstTime: 0, //用户注册时间
longitude: "", //用户经度 longitude: "", //用户经度
cityRank: 99, //城市排名 cityRank: 99, //城市排名
sceneValue: "", //当前场景值
shopDouble: { shopDouble: {
"gold_1": false, "gold_1": false,
"gold_2": false, "gold_2": false,

View File

@ -2076,6 +2076,7 @@ var GameTool = {
let errorData = { let errorData = {
error_type: "javascript", error_type: "javascript",
error_message: error.message || String(error), error_message: error.message || String(error),
error_scene: cc.fx.GameConfig.GM_INFO?.sceneValue || 'null',
error_stack: error.stack || '', error_stack: error.stack || '',
game_version: cc.fx.GameConfig.GM_INFO?.version || 'unknown', game_version: cc.fx.GameConfig.GM_INFO?.version || 'unknown',
user_id: cc.fx.GameConfig.GM_INFO?.userId || 'unknown', user_id: cc.fx.GameConfig.GM_INFO?.userId || 'unknown',

View File

@ -29,8 +29,8 @@ export default class Lock extends cc.Component {
init(time, type, block) { init(time, type, block) {
if (time) this.time = time; if (time) this.time = time;
if (type) this.type = type; if (type) this.type = type;
this.node.getChildByName("time").active = true; this.node.getChildByName("icon").getChildByName("time").active = true;
NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false); NumberToImage.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("icon").getChildByName("time"), false);
let lock = this.node.getChildByName("lock"); let lock = this.node.getChildByName("lock");
if (block != null) { if (block != null) {
switch (block) { switch (block) {

View File

@ -35,6 +35,7 @@ export default class DailyQuests extends cc.Component {
public home: number = 0; public home: number = 0;
public touchStart: boolean = false; public touchStart: boolean = false;
public reward: boolean = false; public reward: boolean = false;
sceneValue: any;
onLoad() { onLoad() {
this.btn_Touch = true; this.btn_Touch = true;
@ -48,6 +49,7 @@ export default class DailyQuests extends cc.Component {
// this.init(); // this.init();
} }
init(data) { init(data) {
this.sceneValue = cc.fx.GameConfig.GM_INFO.sceneValue;
cc.fx.GameConfig.GM_INFO.tasks.levelPass = data["levelPass"]; cc.fx.GameConfig.GM_INFO.tasks.levelPass = data["levelPass"];
cc.fx.GameConfig.GM_INFO.tasks.share = data["share"]; cc.fx.GameConfig.GM_INFO.tasks.share = data["share"];
cc.fx.GameConfig.GM_INFO.tasks.useEnergy = data["useEnergy"]; cc.fx.GameConfig.GM_INFO.tasks.useEnergy = data["useEnergy"];
@ -268,6 +270,8 @@ export default class DailyQuests extends cc.Component {
} }
closeDailyQuests() { closeDailyQuests() {
if (this.sceneValue)
cc.fx.GameConfig.GM_INFO.sceneValue = this.sceneValue;
this.node.active = false; this.node.active = false;
const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点
const jiazaiComp = jiazaiNode.getComponent(JiaZai); const jiazaiComp = jiazaiNode.getComponent(JiaZai);

View File

@ -22,9 +22,6 @@
}, },
{ {
"__id__": 34 "__id__": 34
},
{
"__id__": 37
} }
], ],
"_active": true, "_active": true,
@ -1265,15 +1262,19 @@
"_parent": { "_parent": {
"__id__": 1 "__id__": 1
}, },
"_children": [], "_children": [
"_active": true,
"_components": [
{ {
"__id__": 35 "__id__": 35
} }
], ],
"_active": true,
"_components": [
{
"__id__": 37
}
],
"_prefab": { "_prefab": {
"__id__": 36 "__id__": 38
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1291,14 +1292,14 @@
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": 0.5,
"y": 0.5 "y": 1
}, },
"_trs": { "_trs": {
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
4.941, 47.414,
0, 0,
0, 0,
0, 0,
@ -1322,6 +1323,77 @@
"groupIndex": 0, "groupIndex": 0,
"_id": "" "_id": ""
}, },
{
"__type__": "cc.Node",
"_name": "time",
"_objFlags": 0,
"_parent": {
"__id__": 34
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 36
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-4.914,
-56.628,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "4fERA/vpRLmbBdMjIwwR/p",
"sync": false
},
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
@ -1364,78 +1436,7 @@
"asset": { "asset": {
"__id__": 0 "__id__": 0
}, },
"fileId": "bb95+KyRFKEr1Wy/7D5xg5", "fileId": "9fUIRycoFLUbwjeZfdD6Fc",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "time",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 38
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-4.914,
-9.214,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "48VT9XUVVAfKNIh+R4ESes",
"sync": false "sync": false
}, },
{ {

View File

@ -49,6 +49,7 @@ export default class NewClass extends cc.Component {
private iosCount: number = 1; private iosCount: number = 1;
scheduleCallback3: any; scheduleCallback3: any;
scheduleCallback2: Function; scheduleCallback2: Function;
sceneValue: string = "";
reward: boolean = false; reward: boolean = false;
private monthCard: boolean = false; private monthCard: boolean = false;
doubleInfo: null; doubleInfo: null;
@ -122,8 +123,9 @@ export default class NewClass extends cc.Component {
} }
//打开商店界面 //打开商店界面
openShop() { openShop() {
this.sceneValue = cc.fx.GameConfig.GM_INFO.sceneValue;
Utils.outTradeNo = null; Utils.outTradeNo = null;
cc.fx.GameConfig.GM_INFO.sceneValue = "Shop";
this.initCoin(); this.initCoin();
// 商品数据数组 // 商品数据数组
@ -220,6 +222,8 @@ export default class NewClass extends cc.Component {
} }
//关闭商店界面 //关闭商店界面
closeShop(data, currentCoin) { closeShop(data, currentCoin) {
if (this.sceneValue)
cc.fx.GameConfig.GM_INFO.sceneValue = this.sceneValue;
// 移除 wx.onShow 监听器 // 移除 wx.onShow 监听器
if ((cc.sys.platform === cc.sys.WECHAT_GAME || cc.sys.platform === cc.sys.BYTEDANCE_GAME) && this.onShowListener) { if ((cc.sys.platform === cc.sys.WECHAT_GAME || cc.sys.platform === cc.sys.BYTEDANCE_GAME) && this.onShowListener) {
console.log("shop移除onshow"); console.log("shop移除onshow");