抖音版本大融合 场景和预制体

This commit is contained in:
COMPUTER\EDY 2026-04-24 18:21:23 +08:00
parent 7e4dc3fc88
commit cb4c59b17f
16 changed files with 10382 additions and 4483 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -900,6 +900,7 @@ export default class JiaZai extends cc.Component {
}
}
else {
console.log("获取头像信息失败:", res);
MiniGameSdk.API.showToast("网络异常,获取头像信息失败,请稍后重试");
this.closeLoad();
}

View File

@ -245,7 +245,6 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.parent.getChildByName("zhuanchang").active = false;
}
});
this.pause = false;
this.wall_Pass = [];
this.blocks = [];
this.blocks2 = [];
@ -326,7 +325,6 @@ export default class MapConroler extends cc.Component {
}
}
}, cc.fx.GameConfig.GM_INFO.address);
}
@ -342,8 +340,6 @@ export default class MapConroler extends cc.Component {
// 注意事项:广告预加载代码已被注释
// ============================================
start() {
setTimeout(() => {
cc.director.preloadScene("HomeScene", (err, asset) => {
if (err) {
@ -362,30 +358,14 @@ export default class MapConroler extends cc.Component {
// this.particleEffects = GameManager._instance.particleEffects;
this.initMap();
// 上报游戏加载完成时机(推荐流直玩需要)
cc.fx.GameTool.reportLoadComplete();
// 标记已经自动进入过房间(安全检查)
if (cc.fx && cc.fx.GameConfig && cc.fx.GameConfig.GM_INFO) {
const recommendFeedResult = cc.fx.GameTool.checkRecommendFeedLaunch();
const feedId = recommendFeedResult.feedGameContentId;
const hasAutoEntered = cc.fx && cc.fx.GameConfig && cc.fx.GameConfig.GM_INFO ? cc.fx.GameConfig.GM_INFO.hasAutoEntered : false;
if (!hasAutoEntered && recommendFeedResult && recommendFeedResult.isRecommendFeedLaunch) {
// 推荐流直玩,自动进入游戏房间
if (feedId == "CONTENT13456131074") {
this.timeNumber = 32400;
}
else if (feedId == "CONTENT13394093058") {
this.timeNumber = 32400;
}
else if (feedId == "CONTENT13456131330") {
this.timeNumber = 32400;
}
}
cc.fx.GameConfig.GM_INFO.hasAutoEntered = true;
}
// 加载广告
// cc.fx.GameTool.preloadRewardedVideoAd().then((success) => {
// if (success) {
// console.log("GameScene广告预加载初始化成功");
// } else {
// console.log("GameScene广告预加载初始化失败");
// }
// });
}
// ============================================
// 设置道具数量显示方法
@ -649,7 +629,6 @@ export default class MapConroler extends cc.Component {
let gap = cc.fx.GameConfig.LEVEL_INFO[0].gap;
let risefall = cc.fx.GameConfig.LEVEL_INFO[0].risefall;
this.pause = false;
this.shopPause = false;//商店暂停状态
this.hammer = false;
@ -1101,9 +1080,6 @@ export default class MapConroler extends cc.Component {
if (this.revolving_state != 0) {
this.createRevolvingWall();
}
if (this.jump_state != null) {
this.createJumpWall();
}
}
}
@ -1683,6 +1659,7 @@ export default class MapConroler extends cc.Component {
// 注意:这个方法的内容已被注释,不再执行任何操作
// ============================================
jumpWallAction(startPos, endPos, wall) {
// debugger;
// let startWall = this.jumpWallArray[startPos][0].getChildByName("revolving");
// let startLength = this.jumpWallArray[startPos][0].getChildByName("wall").getComponent("Wall").wall_Info.length;
// let endWall = this.jumpWallArray[endPos][0].getChildByName("revolving");
@ -2452,28 +2429,31 @@ export default class MapConroler extends cc.Component {
wallArray.push(this.jumpWallArray[i][j]);
if (this.jumpWallArray[i][j].getChildByName("wall").getComponent("Wall").jumpNode) {
for (let k = 0; k < wall.length; k++) {
console.log("跳完是空的:", this.jumpWallArray[i][j].getChildByName("wall").getComponent("Wall").wall_Info.num);
this.jumpWallArray[i][j].getChildByName("wall").getComponent("Wall").changeJumpWall(false);
}
}
}
}
let toActivateNext: number[] = [];
for (let i = 0; i < wallArray.length; i++) {
if (wallArray[i].getChildByName("wall").getComponent("Wall").jumpNode) {
wallArray[i].getChildByName("wall").getComponent("Wall").jumpNode = null;
if (i == wallArray.length - 1) {
wallArray[0].getChildByName("wall").getComponent("Wall").changeJumpWall(true);
}
else {
wallArray[i + 1].getChildByName("wall").getComponent("Wall").changeJumpWall(true);
i += 1;
let nextIndex = (i == wallArray.length - 1) ? 0 : i + 1;
toActivateNext.push(nextIndex);
}
}
if (i == wallArray.length - 1) {
for (let j = 0; j < toActivateNext.length; j++) {
let index = toActivateNext[j];
wallArray[index].getChildByName("wall").getComponent("Wall").changeJumpWall(true);
console.log("跳完是有的:", wallArray[index].getChildByName("wall").getComponent("Wall").wall_Info.num);
}
this.changeLength(wallArray);
}
}
}
//跳跃门改变后的长度变化
changeLength(wallArray) {
@ -3244,23 +3224,7 @@ export default class MapConroler extends cc.Component {
this.count_Time = overTime - this.count_Time;
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
if (cc.fx.GameConfig.GM_INFO.GameplayType == 2) {
console.log("抖音广告进来进行结算时上报 ————————————————————————");
let time1 = this.count_Time;
let time2 = this.add_Time;
let is_frenzy = false;
if (MapConroler._instance) {
is_frenzy = MapConroler._instance.is_frenzy;
}
let data = {
time: time1,
add_Time: time2,
is_frenzy: is_frenzy,
result: "success",
infinity: false,
}
cc.fx.GameTool.shushu_Track("finish_stage", data);
}
}
else cc.fx.GameTool.addLevel(this.count_Time, this.add_Time, (data) => {
@ -3718,7 +3682,7 @@ export default class MapConroler extends cc.Component {
cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
this.adhesiveBlock = [];
this.powerState = cc.fx.GameTool.getUserPowerTime();
console.log("无限体力状态", MapConroler._instance.powerState);
if (cc.fx.GameConfig.GM_INFO.hp < 1 && MapConroler._instance.powerState == false) {
MiniGameSdk.API.showToast("体力值不足");
setTimeout(() => {
@ -3908,6 +3872,7 @@ export default class MapConroler extends cc.Component {
}
this.node.parent.parent.getChildByName("Lose").active = false;
setTimeout(() => {
this.reviewState = false;
@ -4103,7 +4068,7 @@ export default class MapConroler extends cc.Component {
//上传数据到云存储
uploadToCloud(level: number) {
//@ts-ignore
if (cc.sys.platform === cc.sys.WECHAT_GAME && typeof wx !== 'undefined') {
if (typeof wx !== 'undefined') {
//@ts-ignore
wx.setUserCloudStorage({
KVDataList: [
@ -4112,26 +4077,12 @@ export default class MapConroler extends cc.Component {
success: () => console.log('✅ 数据上传成功'),
fail: (err) => console.error('❌ 上传失败', err)
});
//@ts-ignore
} else if (cc.sys.platform === cc.sys.BYTEDANCE_GAME && typeof tt !== 'undefined') {
//@ts-ignore
// tt.setUserCloudStorage({
// KVDataList: [
// { key: 'level', value: String(level) }
// ],
// success: () => console.log('✅ 抖音数据上传成功'),
// fail: (err) => console.error('❌ 抖音上传失败', err)
// });
}
}
//返回主界面
returnHome(event, customEventData) {
cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
if (cc.fx.GameConfig.GM_INFO.GameplayType == 2) {
console.log("抖音推流关卡结束了!!!!!!!!");
cc.fx.GameConfig.GM_INFO.GameplayType = 0;
}
if (MapConroler._instance = null) {
return;
}
@ -4953,6 +4904,9 @@ export default class MapConroler extends cc.Component {
//打开商店
openShop() {
if (!cc.fx.GameConfig.GM_INFO.canIos) {
return;
}
const winCOIN = cc.find("Canvas"); // 假设 Canvas 节点
if (winCOIN) {
const wincoin = winCOIN.getComponent(SceneManager);
@ -5577,7 +5531,6 @@ export default class MapConroler extends cc.Component {
}
// ============================================
// 暂停游戏方法
// 功能:切换游戏的暂停/继续状态
@ -5597,6 +5550,7 @@ export default class MapConroler extends cc.Component {
}
}
else {
debugger;
this.pause = true;
this.stopBoom();
}
@ -6389,7 +6343,7 @@ export default class MapConroler extends cc.Component {
//设置帮助他人通关
setOtherLevel() {
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0 && cc.fx.GameConfig.GM_INFO.GameplayType != 2) {
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
console.log("帮助他人通关");
let level = cc.fx.GameConfig.GM_INFO.otherLevel;
let uid = cc.fx.GameConfig.GM_INFO.otherUid;

View File

@ -528,7 +528,7 @@ export default class Utils {
}
url = this.httpip + url;
//console.log("请求地址:" + url);
console.log("请求地址:" + url);
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function () {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
{
"ver": "1.3.2",
"uuid": "bb3bea9a-5cb6-4279-9d92-6d2c999ce95e",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

BIN
assets/shop/img/tu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "e21a80a2-8b81-4d9f-95cb-96e239802635",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 860,
"height": 860,
"platformSettings": {},
"subMetas": {
"tu": {
"ver": "1.0.6",
"uuid": "e5263cc8-e959-4dcc-8c95-620f254328f2",
"importer": "sprite-frame",
"rawTextureUuid": "e21a80a2-8b81-4d9f-95cb-96e239802635",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": -2,
"trimX": 35,
"trimY": 62,
"width": 792,
"height": 740,
"rawWidth": 860,
"rawHeight": 860,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -36,11 +36,11 @@
"_active": true,
"_components": [
{
"__id__": 45
"__id__": 50
}
],
"_prefab": {
"__id__": 46
"__id__": 51
},
"_opacity": 255,
"_color": {
@ -1574,15 +1574,18 @@
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
"_children": [
{
"__id__": 43
},
{
"__id__": 46
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 44
"__id__": 49
},
"_opacity": 255,
"_color": {
@ -1594,8 +1597,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 119,
"height": 54
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -1606,8 +1609,72 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
310.459,
-76.145,
298.857,
-81.221,
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.Node",
"_name": "cost_6",
"_objFlags": 0,
"_parent": {
"__id__": 42
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 44
}
],
"_prefab": {
"__id__": 45
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 43,
"height": 46
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-9.47,
4.133,
0,
0,
0,
@ -1636,7 +1703,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 42
"__id__": 43
},
"_enabled": true,
"_materials": [
@ -1647,7 +1714,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0838c782-3811-4df4-a8a5-9b695604f215"
"__uuid__": "30b3ef49-bd7e-47a6-84b2-da05678348a6"
},
"_type": 0,
"_sizeMode": 1,
@ -1660,9 +1727,131 @@
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_atlas": {
"__uuid__": "569f5a4d-beff-465f-be16-fc3bcf467850"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "40Vq/RJlJIbYiYQrkzcOPv",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "cost_10",
"_objFlags": 0,
"_parent": {
"__id__": 42
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 47
}
],
"_prefab": {
"__id__": 48
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 47,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
46.741,
3.724,
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.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "646c3b71-e143-4d0f-94e6-534c77123f6d"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "569f5a4d-beff-465f-be16-fc3bcf467850"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "f4509ztm9F1bN6uB3TbwkM",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {

View File

@ -600,8 +600,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 114,
"height": 114
"width": 112,
"height": 112
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -775,8 +775,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 460
"width": 792,
"height": 740
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -828,7 +828,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "90eaac0d-aa2e-43f4-b2d5-ac63e4a96f91"
"__uuid__": "e5263cc8-e959-4dcc-8c95-620f254328f2"
},
"_type": 0,
"_sizeMode": 1,

File diff suppressed because it is too large Load Diff

View File

@ -3893,7 +3893,7 @@
"ctor": "Float64Array",
"array": [
-395,
511.671,
750,
0,
0,
0,
@ -4100,7 +4100,7 @@
"ctor": "Float64Array",
"array": [
410,
511.671,
750,
0,
0,
0,
@ -5440,8 +5440,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 142,
"height": 129
"width": 116,
"height": 124
},
"_anchorPoint": {
"__type__": "cc.Vec2",

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
"webOrientation": "portrait",
"inlineSpriteFrames": true,
"inlineSpriteFrames_native": true,
"mainCompressionType": "subpackage",
"mainCompressionType": "default",
"mainIsRemote": false,
"optimizeHotUpdate": false,
"md5Cache": true,

View File

@ -1,5 +1,5 @@
{
"last-module-event-record-time": 1776308548630,
"last-module-event-record-time": 1777019616397,
"group-list": [
"default",
"Map"