测试版本

master
humingxing 7 days ago
parent 78e6355765
commit 9508d1accb
  1. 1323
      assets/bundles/home/prefab/PanelHome.prefab
  2. 9
      assets/res/home/spine/首页效果.meta
  3. 1
      assets/res/home/spine/首页效果/.WeDrive
  4. 293
      assets/res/home/spine/首页效果/首页场景.atlas
  5. 12
      assets/res/home/spine/首页效果/首页场景.atlas.meta
  6. 1
      assets/res/home/spine/首页效果/首页场景.json
  7. 13
      assets/res/home/spine/首页效果/首页场景.json.meta
  8. BIN
      assets/res/home/spine/首页效果/首页场景.png
  9. 134
      assets/res/home/spine/首页效果/首页场景.png.meta
  10. 181
      assets/res/home/spine/首页效果/首页数字.atlas
  11. 12
      assets/res/home/spine/首页效果/首页数字.atlas.meta
  12. 1
      assets/res/home/spine/首页效果/首页数字.json
  13. 13
      assets/res/home/spine/首页效果/首页数字.json.meta
  14. BIN
      assets/res/home/spine/首页效果/首页数字.png
  15. 134
      assets/res/home/spine/首页效果/首页数字.png.meta
  16. 210
      assets/script/ui/PanelHome/PanelHomeSceneSwitchPresenter.ts
  17. 9
      assets/script/ui/PanelHome/PanelHomeSceneSwitchPresenter.ts.meta
  18. 10
      assets/script/ui/PanelHome/UIPanelHome.ts
  19. 2
      bin/tt_wkbz1.2.4.bin

File diff suppressed because it is too large Load Diff

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "dc72c5d9-64d9-4a4a-b603-25336632039e",
"files": [],
"subMetas": {},
"userData": {}
}

@ -0,0 +1 @@
D:\WXWork\1688855084654441\WeDrive\中昱智云\抖音游戏\战斗类\【新】2048数字守卫战\动效\首页效果

@ -0,0 +1,293 @@
首页场景.png
size: 1981,860
format: RGBA8888
filter: Linear,Linear
repeat: none
初始/上1
rotate: true
xy: 1905, 237
size: 96, 74
orig: 98, 76
offset: 1, 1
index: -1
覆水/上1
rotate: true
xy: 1905, 237
size: 96, 74
orig: 98, 76
offset: 1, 1
index: -1
初始/中
rotate: true
xy: 0, 316
size: 544, 410
orig: 546, 412
offset: 1, 1
index: -1
覆水/中
rotate: true
xy: 0, 316
size: 544, 410
orig: 546, 412
offset: 1, 1
index: -1
初始/右1
rotate: false
xy: 1652, 18
size: 161, 125
orig: 163, 127
offset: 1, 1
index: -1
覆水/右1
rotate: false
xy: 1652, 18
size: 161, 125
orig: 163, 127
offset: 1, 1
index: -1
初始/左1
rotate: true
xy: 1815, 21
size: 122, 94
orig: 124, 96
offset: 1, 1
index: -1
覆水/左1
rotate: true
xy: 1815, 21
size: 122, 94
orig: 124, 96
offset: 1, 1
index: -1
熔浆/1
rotate: false
xy: 645, 1
size: 47, 33
orig: 49, 35
offset: 1, 1
index: -1
熔浆/10
rotate: true
xy: 1594, 459
size: 86, 45
orig: 90, 50
offset: 1, 3
index: -1
熔浆/2
rotate: false
xy: 1070, 4
size: 51, 36
orig: 58, 39
offset: 6, 1
index: -1
熔浆/3
rotate: false
xy: 885, 2
size: 56, 37
orig: 58, 39
offset: 1, 1
index: -1
熔浆/4
rotate: false
xy: 1911, 101
size: 56, 42
orig: 60, 44
offset: 2, 1
index: -1
熔浆/5
rotate: false
xy: 1905, 145
size: 59, 44
orig: 63, 47
offset: 2, 1
index: -1
熔浆/6
rotate: false
xy: 1905, 191
size: 67, 44
orig: 69, 46
offset: 1, 1
index: -1
熔浆/7
rotate: false
xy: 807, 1
size: 76, 38
orig: 78, 40
offset: 1, 1
index: -1
熔浆/8
rotate: true
xy: 1594, 547
size: 86, 47
orig: 88, 49
offset: 1, 1
index: -1
熔浆/9
rotate: true
xy: 1594, 635
size: 90, 48
orig: 92, 50
offset: 1, 1
index: -1
熔浆/上1
rotate: true
xy: 1362, 328
size: 97, 76
orig: 99, 78
offset: 1, 1
index: -1
熔浆/中
rotate: true
xy: 412, 316
size: 544, 410
orig: 546, 412
offset: 1, 1
index: -1
熔浆/右1
rotate: false
xy: 1644, 335
size: 162, 126
orig: 164, 128
offset: 1, 1
index: -1
熔浆/左1
rotate: false
xy: 1236, 328
size: 124, 97
orig: 126, 99
offset: 1, 1
index: -1
熔浆/高光
rotate: false
xy: 1594, 727
size: 387, 133
orig: 391, 136
offset: 3, 1
index: -1
覆水/10001
rotate: false
xy: 0, 11
size: 268, 303
orig: 286, 391
offset: 7, 45
index: -1
覆水/10002
rotate: true
xy: 1060, 42
size: 272, 324
orig: 286, 391
offset: 4, 3
index: -1
覆水/10003
rotate: true
xy: 1644, 463
size: 262, 335
orig: 286, 391
offset: 14, 33
index: -1
覆水/10004
rotate: false
xy: 533, 36
size: 265, 278
orig: 286, 391
offset: 11, 40
index: -1
覆水/10005
rotate: false
xy: 270, 16
size: 261, 298
orig: 286, 391
offset: 7, 55
index: -1
覆水/10006
rotate: false
xy: 1652, 155
size: 251, 178
orig: 286, 391
offset: 17, 47
index: -1
覆水/10007
rotate: false
xy: 800, 41
size: 258, 273
orig: 286, 391
offset: 14, 55
index: -1
覆水/10008
rotate: false
xy: 1386, 5
size: 264, 321
orig: 286, 391
offset: 9, 44
index: -1
覆水/右光1
rotate: true
xy: 943, 3
size: 36, 125
orig: 42, 197
offset: 2, 46
index: -1
覆水/右光2
rotate: true
xy: 533, 0
size: 34, 110
orig: 37, 181
offset: 1, 34
index: -1
覆水/左光1
rotate: true
xy: 1123, 22
size: 18, 77
orig: 21, 126
offset: 2, 3
index: -1
覆水/左光2
rotate: true
xy: 720, 14
size: 20, 85
orig: 26, 174
offset: 2, 87
index: -1
覆水/水面
rotate: false
xy: 1236, 427
size: 356, 433
orig: 358, 436
offset: 1, 2
index: -1
雪地/bstw_3
rotate: true
xy: 694, 8
size: 26, 24
orig: 28, 26
offset: 1, 1
index: -1
雪地/上1
rotate: true
xy: 1440, 328
size: 97, 76
orig: 99, 78
offset: 1, 1
index: -1
雪地/中
rotate: true
xy: 824, 316
size: 544, 410
orig: 546, 412
offset: 1, 1
index: -1
雪地/右1
rotate: false
xy: 1808, 335
size: 162, 126
orig: 164, 128
offset: 1, 1
index: -1
雪地/左1
rotate: false
xy: 1518, 329
size: 124, 96
orig: 126, 98
offset: 1, 1
index: -1

@ -0,0 +1,12 @@
{
"ver": "1.0.0",
"importer": "*",
"imported": true,
"uuid": "1f469c4b-2de5-4385-bdbe-568763c7ca0b",
"files": [
".atlas",
".json"
],
"subMetas": {},
"userData": {}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,13 @@
{
"ver": "1.2.7",
"importer": "spine-data",
"imported": true,
"uuid": "681247cc-b4b2-4cc9-accb-52dcf80437cd",
"files": [
".json"
],
"subMetas": {},
"userData": {
"atlasUuid": "1f469c4b-2de5-4385-bdbe-568763c7ca0b"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "0825f725-5a04-4cf8-97c7-a475deb72116",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "0825f725-5a04-4cf8-97c7-a475deb72116@6c48a",
"displayName": "首页场景",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "0825f725-5a04-4cf8-97c7-a475deb72116",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "0825f725-5a04-4cf8-97c7-a475deb72116@f9941",
"displayName": "首页场景",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1981,
"height": 860,
"rawWidth": 1981,
"rawHeight": 860,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-990.5,
-430,
0,
990.5,
-430,
0,
-990.5,
430,
0,
990.5,
430,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
860,
1981,
860,
0,
0,
1981,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-990.5,
-430,
0
],
"maxPos": [
990.5,
430,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "0825f725-5a04-4cf8-97c7-a475deb72116@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": false,
"hasAlpha": true,
"redirect": "0825f725-5a04-4cf8-97c7-a475deb72116@6c48a"
}
}

@ -0,0 +1,181 @@
首页数字.png
size: 2033,934
format: RGBA8888
filter: Linear,Linear
repeat: none
256号
rotate: false
xy: 1173, 7
size: 184, 107
orig: 186, 109
offset: 1, 1
index: -1
AOE光圈扩散1
rotate: false
xy: 1518, 628
size: 102, 102
orig: 114, 113
offset: 6, 5
index: -1
AOE光圈扩散2
rotate: true
xy: 1638, 18
size: 227, 226
orig: 241, 239
offset: 7, 6
index: -1
AOE光圈扩散3
rotate: false
xy: 627, 0
size: 380, 386
orig: 403, 408
offset: 10, 12
index: -1
AOE光圈扩散4
rotate: false
xy: 582, 388
size: 542, 546
orig: 564, 576
offset: 12, 15
index: -1
AOE光圈扩散5
rotate: false
xy: 0, 343
size: 580, 591
orig: 606, 626
offset: 10, 14
index: -1
光点1
rotate: true
xy: 0, 25
size: 316, 142
orig: 336, 149
offset: 0, 4
index: -1
光点2
rotate: true
xy: 1173, 116
size: 368, 99
orig: 370, 103
offset: 2, 2
index: -1
光点3
rotate: true
xy: 1708, 748
size: 186, 147
orig: 212, 166
offset: 9, 0
index: -1
光点4
rotate: true
xy: 435, 88
size: 253, 190
orig: 293, 225
offset: 26, 20
index: -1
刀光1
rotate: true
xy: 1274, 242
size: 242, 241
orig: 251, 250
offset: 5, 4
index: -1
刀光2
rotate: false
xy: 1406, 1
size: 230, 239
orig: 239, 249
offset: 6, 4
index: -1
刀光3
rotate: false
xy: 1517, 247
size: 223, 237
orig: 232, 248
offset: 7, 4
index: -1
刀光4
rotate: true
xy: 1797, 423
size: 201, 227
orig: 218, 242
offset: 8, 5
index: -1
刀光5
rotate: false
xy: 1518, 732
size: 188, 202
orig: 202, 212
offset: 8, 0
index: -1
刀光6
rotate: true
xy: 1742, 248
size: 173, 202
orig: 191, 208
offset: 8, 6
index: -1
挥砍1
rotate: false
xy: 1866, 781
size: 167, 153
orig: 177, 164
offset: 6, 5
index: -1
挥砍2
rotate: false
xy: 1866, 626
size: 161, 153
orig: 173, 164
offset: 7, 5
index: -1
挥砍3
rotate: true
xy: 1866, 94
size: 152, 153
orig: 167, 164
offset: 8, 4
index: -1
挥砍4
rotate: true
xy: 1518, 486
size: 138, 146
orig: 160, 161
offset: 9, 6
index: -1
挥砍5
rotate: false
xy: 1666, 492
size: 129, 132
orig: 151, 144
offset: 10, 1
index: -1
挥砍6
rotate: true
xy: 1274, 116
size: 124, 130
orig: 144, 141
offset: 10, 6
index: -1
法杖
rotate: false
xy: 1009, 15
size: 162, 371
orig: 162, 371
offset: 0, 0
index: -1
法阵11
rotate: true
xy: 144, 47
size: 294, 289
orig: 296, 290
offset: 1, 0
index: -1
聚集光能
rotate: false
xy: 1126, 486
size: 390, 448
orig: 406, 464
offset: 8, 8
index: -1

@ -0,0 +1,12 @@
{
"ver": "1.0.0",
"importer": "*",
"imported": true,
"uuid": "8e694d7d-6091-4b9f-84eb-59982fd137ad",
"files": [
".atlas",
".json"
],
"subMetas": {},
"userData": {}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,13 @@
{
"ver": "1.2.7",
"importer": "spine-data",
"imported": true,
"uuid": "e16078ad-e097-4a0b-af51-a986b6cf2052",
"files": [
".json"
],
"subMetas": {},
"userData": {
"atlasUuid": "8e694d7d-6091-4b9f-84eb-59982fd137ad"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 KiB

@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "2cbffc69-c705-4cf8-b989-c615446556ec",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "2cbffc69-c705-4cf8-b989-c615446556ec@6c48a",
"displayName": "首页数字",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "2cbffc69-c705-4cf8-b989-c615446556ec",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "2cbffc69-c705-4cf8-b989-c615446556ec@f9941",
"displayName": "首页数字",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2033,
"height": 934,
"rawWidth": 2033,
"rawHeight": 934,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-1016.5,
-467,
0,
1016.5,
-467,
0,
-1016.5,
467,
0,
1016.5,
467,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
934,
2033,
934,
0,
0,
2033,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-1016.5,
-467,
0
],
"maxPos": [
1016.5,
467,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "2cbffc69-c705-4cf8-b989-c615446556ec@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": false,
"hasAlpha": true,
"redirect": "2cbffc69-c705-4cf8-b989-c615446556ec@6c48a"
}
}

@ -0,0 +1,210 @@
import { Component, Node, sp } from 'cc';
import { ensureSpineSkeletonDataRuntime } from 'db://assets/mx/module/lang/spineRuntimePatch';
/** 首页场景节点名 */
const NODE_SCENE = '首页场景';
/** 首页数字节点名 */
const NODE_NUM = '首页数字';
/** 数字待机动画 */
const ANIM_IDLE = '待机';
/** 数字场景变换动画 */
const ANIM_SWITCH = '场景变换';
/** 变换动画内切场景的事件名 */
const EVENT_SWITCH = '开始渐隐变换场景';
/** 场景皮肤列表 */
const SCENE_SKINS = ['初始', '熔浆', '覆水', '雪地'] as const;
/** 切换间隔下限(秒) */
const INTERVAL_MIN = 3;
/** 切换间隔上限(秒) */
const INTERVAL_MAX = 5;
/**
* 首页场景皮肤随机切换:间隔 3~5 秒,播「场景变换」,在事件帧切皮肤,播完回待机。
*/
export class PanelHomeSceneSwitchPresenter {
private _host: Component | null = null;
private _levelSelect: Node | null = null;
private _sceneSkel: sp.Skeleton | null = null;
private _numSkel: sp.Skeleton | null = null;
private _skinIndex = 0;
private _switching = false;
/**
* 绑定宿主与 ui_levelSelect,解析 Spine 并开局待机。
* @param host 用于 schedule 的组件(PanelHome)
* @param levelSelect ui_levelSelect
*/
bind(host: Component | null | undefined, levelSelect: Node | null | undefined): void {
this.unbind();
if (!host?.isValid || !levelSelect?.isValid) {
console.log('[PanelHomeSceneSwitch] 绑定参数无效');
return;
}
this._host = host;
this._levelSelect = levelSelect;
this._sceneSkel = this._resolveSkel(NODE_SCENE);
this._numSkel = this._resolveSkel(NODE_NUM);
if (!this._sceneSkel || !this._numSkel) return;
this._skinIndex = this._resolveCurrentSkinIndex(this._sceneSkel);
this._playIdle();
this._scheduleNext();
}
/** 停止定时与切换,解除引用 */
unbind(): void {
this._switching = false;
const host = this._host;
if (host?.isValid) {
host.unschedule(this._onInterval);
host.unschedule(this._onSwitchEvent);
host.unschedule(this._onSwitchAnimDone);
}
this._host = null;
this._levelSelect = null;
this._sceneSkel = null;
this._numSkel = null;
}
/** 解析子节点 Spine */
private _resolveSkel(name: string): sp.Skeleton | null {
const root = this._levelSelect;
if (!root?.isValid) return null;
const node = root.getChildByName(name);
if (!node?.isValid) {
console.log('[PanelHomeSceneSwitch] 节点缺失', name);
return null;
}
const skel = node.getComponent(sp.Skeleton);
if (!skel) {
console.log('[PanelHomeSceneSwitch] 缺少 sp.Skeleton', name);
return null;
}
if (skel.skeletonData) {
ensureSpineSkeletonDataRuntime(skel.skeletonData);
}
return skel;
}
/** 读 Inspector defaultSkin 在列表中的下标;未知则 0 */
private _resolveCurrentSkinIndex(skel: sp.Skeleton): number {
const cur = String((skel as sp.Skeleton & { defaultSkin?: string }).defaultSkin ?? '').trim();
for (let i = 0; i < SCENE_SKINS.length; i++) {
if (SCENE_SKINS[i] === cur) return i;
}
console.log('[PanelHomeSceneSwitch] 当前皮肤不在列表,按初始处理', cur);
return 0;
}
/** 数字播待机循环 */
private _playIdle(): void {
const num = this._numSkel;
if (!num?.isValid) return;
if (num.skeletonData) ensureSpineSkeletonDataRuntime(num.skeletonData);
if (!num.findAnimation(ANIM_IDLE)) {
console.log('[PanelHomeSceneSwitch] 缺少动画', ANIM_IDLE);
return;
}
num.setAnimation(0, ANIM_IDLE, true);
}
/** 随机 3~5 秒后再切 */
private _scheduleNext(): void {
const host = this._host;
if (!host?.isValid) return;
host.unschedule(this._onInterval);
const delay = INTERVAL_MIN + Math.random() * (INTERVAL_MAX - INTERVAL_MIN);
host.scheduleOnce(this._onInterval, delay);
}
/** 读动画事件时刻(秒);无则 null */
private _findAnimEventTime(skel: sp.Skeleton, animName: string, eventName: string): number | null {
if (!skel?.isValid || !animName || !eventName) return null;
const sd = skel.skeletonData as sp.SkeletonData & { skeletonJson?: unknown; _skeletonJson?: unknown };
if (!sd?.isValid) return null;
try {
ensureSpineSkeletonDataRuntime(sd);
const raw = (sd.skeletonJson ?? sd._skeletonJson) as {
animations?: Record<string, { events?: Array<{ time?: number; name?: string }> }>;
} | null;
const events = raw?.animations?.[animName]?.events;
if (!events || events.length === 0) return null;
for (let i = 0; i < events.length; i++) {
const e = events[i];
if (String(e?.name ?? '') !== eventName) continue;
const t = Number(e.time);
if (!Number.isFinite(t) || t < 0) continue;
return t;
}
return null;
} catch {
return null;
}
}
/** 间隔到:播场景变换,事件帧切皮,播完回待机 */
private _onInterval = (): void => {
if (this._switching) return;
const num = this._numSkel;
const host = this._host;
if (!num?.isValid || !host?.isValid) return;
if (num.skeletonData) ensureSpineSkeletonDataRuntime(num.skeletonData);
const anim = num.findAnimation(ANIM_SWITCH);
if (!anim) {
console.log('[PanelHomeSceneSwitch] 缺少动画', ANIM_SWITCH);
this._scheduleNext();
return;
}
const eventTime = this._findAnimEventTime(num, ANIM_SWITCH, EVENT_SWITCH);
if (eventTime == null) {
console.log('[PanelHomeSceneSwitch] 缺少事件帧', EVENT_SWITCH, ANIM_SWITCH);
this._scheduleNext();
return;
}
const duration = Number(anim.duration);
const scale = Math.max(0.01, num.timeScale || 1);
const eventDelay = eventTime / scale;
const doneDelay = (Number.isFinite(duration) && duration > 0 ? duration : eventTime) / scale;
this._switching = true;
num.setAnimation(0, ANIM_SWITCH, false);
host.unschedule(this._onSwitchEvent);
host.unschedule(this._onSwitchAnimDone);
host.scheduleOnce(this._onSwitchEvent, eventDelay);
host.scheduleOnce(this._onSwitchAnimDone, Math.max(eventDelay, doneDelay));
};
/** 事件帧:随机其他皮肤 */
private _onSwitchEvent = (): void => {
if (!this._switching) return;
const scene = this._sceneSkel;
if (!scene?.isValid) return;
const next = this._pickOtherSkinIndex(this._skinIndex);
const skin = SCENE_SKINS[next];
if (scene.skeletonData) ensureSpineSkeletonDataRuntime(scene.skeletonData);
try {
(scene as sp.Skeleton & { defaultSkin: string }).defaultSkin = skin;
scene.setSkin(skin);
scene.setSlotsToSetupPose();
this._skinIndex = next;
} catch (err) {
console.log('[PanelHomeSceneSwitch] setSkin 失败', skin, err);
}
};
/** 变换播完:回待机并排下次 */
private _onSwitchAnimDone = (): void => {
if (!this._switching) return;
this._switching = false;
this._playIdle();
this._scheduleNext();
};
/** 从当前以外的 3 个皮肤中随机下标 */
private _pickOtherSkinIndex(cur: number): number {
const others: number[] = [];
for (let i = 0; i < SCENE_SKINS.length; i++) {
if (i !== cur) others.push(i);
}
if (others.length === 0) return cur;
return others[Math.floor(Math.random() * others.length)];
}
}

@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "3e171efe-7590-42b2-862a-19fa647dc07d",
"files": [],
"subMetas": {},
"userData": {}
}

@ -4,7 +4,7 @@
// time: Tue Aug 18 2026 // time: Tue Aug 18 2026
// desc: // desc:
//********************* //*********************
import { _decorator, Button, isValid, Label, sp } from 'cc'; import { _decorator, Button, isValid, Label } from 'cc';
import { Auto_PanelHome } from './Auto_PanelHome'; import { Auto_PanelHome } from './Auto_PanelHome';
import { UIID } from '../../game/ConfigRes'; import { UIID } from '../../game/ConfigRes';
import { ItemNumType, StatusType } from '../../game/GameData'; import { ItemNumType, StatusType } from '../../game/GameData';
@ -13,16 +13,14 @@ import { EmolumentDataManager } from '../../manager/EmolumentDataManager';
import { RankDataManager } from '../../manager/RankDataManager'; import { RankDataManager } from '../../manager/RankDataManager';
import { sdkConfig } from '../../sdk/sdkConfig'; import { sdkConfig } from '../../sdk/sdkConfig';
import { GEvent } from 'db://assets/mx/module/event/GEvent'; import { GEvent } from 'db://assets/mx/module/event/GEvent';
import { BattleSpinePlayback } from 'db://assets/script/battle/presentation/BattleSpinePlayback';
import { EmolumentCoinFlySource, PanelHomeEmolumentCoinFlyPresenter } from './PanelHomeEmolumentCoinFlyPresenter'; import { EmolumentCoinFlySource, PanelHomeEmolumentCoinFlyPresenter } from './PanelHomeEmolumentCoinFlyPresenter';
import { PanelHomeSceneSwitchPresenter } from './PanelHomeSceneSwitchPresenter';
import { PanelHomeStartVigourFlyPresenter } from './PanelHomeStartVigourFlyPresenter'; import { PanelHomeStartVigourFlyPresenter } from './PanelHomeStartVigourFlyPresenter';
import { MiniGamePf } from 'db://assets/mx/tools/MiniGameHostInfo'; import { MiniGamePf } from 'db://assets/mx/tools/MiniGameHostInfo';
import { VivoAd } from '../../sdk/functions/VivoAd'; import { VivoAd } from '../../sdk/functions/VivoAd';
const { ccclass } = _decorator; const { ccclass } = _decorator;
/** 首页关卡 Spine 可随机动画 */
const CHAPTER_SPINE_ANIMS = ['动画1', '动画2', '动画3'] as const;
/** btnStart 体力底与数量 Label 节点名 */ /** btnStart 体力底与数量 Label 节点名 */
const START_POWER_BG_NODE = 'powerBg'; const START_POWER_BG_NODE = 'powerBg';
const START_POWER_LABEL_NODE = 'lb_power'; const START_POWER_LABEL_NODE = 'lb_power';
@ -34,6 +32,8 @@ export class UIPanelHome extends Auto_PanelHome {
private readonly _startVigourFly = new PanelHomeStartVigourFlyPresenter(); private readonly _startVigourFly = new PanelHomeStartVigourFlyPresenter();
/** 俸禄领取:金币影子飞向 ui_money */ /** 俸禄领取:金币影子飞向 ui_money */
private readonly _emolumentCoinFly = new PanelHomeEmolumentCoinFlyPresenter(); private readonly _emolumentCoinFly = new PanelHomeEmolumentCoinFlyPresenter();
/** 首页场景皮肤定时随机切换 */
private readonly _sceneSwitch = new PanelHomeSceneSwitchPresenter();
/** 桌面礼包弹窗打开中,防重复 */ /** 桌面礼包弹窗打开中,防重复 */
private _deskGiftOpen = false; private _deskGiftOpen = false;
@ -50,6 +50,7 @@ export class UIPanelHome extends Auto_PanelHome {
super.onEnable(); super.onEnable();
this._startVigourFly.bind(this.node, this.ui_vigour, this.btnStart); this._startVigourFly.bind(this.node, this.ui_vigour, this.btnStart);
this._emolumentCoinFly.bind(this.node, this.ui_money); this._emolumentCoinFly.bind(this.node, this.ui_money);
this._sceneSwitch.bind(this, this.ui_levelSelect);
this._setBtnStartInteractable(true); this._setBtnStartInteractable(true);
GEvent.Ins.on(GEvent.UpdateRankStars, this._refreshRankDisplay, this); GEvent.Ins.on(GEvent.UpdateRankStars, this._refreshRankDisplay, this);
GEvent.Ins.on(GEvent.PLATFORM_SHOW, this._tryClaimDeskGift, this); GEvent.Ins.on(GEvent.PLATFORM_SHOW, this._tryClaimDeskGift, this);
@ -64,6 +65,7 @@ export class UIPanelHome extends Auto_PanelHome {
GEvent.Ins.off(GEvent.UpdateRankStars, this._refreshRankDisplay, this); GEvent.Ins.off(GEvent.UpdateRankStars, this._refreshRankDisplay, this);
GEvent.Ins.off(GEvent.PLATFORM_SHOW, this._tryClaimDeskGift, this); GEvent.Ins.off(GEvent.PLATFORM_SHOW, this._tryClaimDeskGift, this);
VivoAd.hideBanner(); VivoAd.hideBanner();
this._sceneSwitch.unbind();
this._startVigourFly.unbind(); this._startVigourFly.unbind();
this._emolumentCoinFly.unbind(); this._emolumentCoinFly.unbind();
this._setBtnStartInteractable(true); this._setBtnStartInteractable(true);

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save