shop 从首场景拆分完毕
This commit is contained in:
parent
07169e59f4
commit
7fd60ef294
|
|
@ -219,9 +219,9 @@ export default class GameManager extends cc.Component {
|
||||||
cc.tween(this.lizi)
|
cc.tween(this.lizi)
|
||||||
.to(0.5, { position: cc.v3(410, -516.426, 0) })
|
.to(0.5, { position: cc.v3(410, -516.426, 0) })
|
||||||
.start();
|
.start();
|
||||||
cc.assetManager.loadBundle('shop', (shopError) => {
|
cc.assetManager.loadBundle('publicUI', (publicUIError) => {
|
||||||
if (shopError) {
|
if (publicUIError) {
|
||||||
console.error('加载 shop 失败:', shopError);
|
console.error('加载 publicUI 失败:', publicUIError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cc.director.loadScene("HomeScene");
|
cc.director.loadScene("HomeScene");
|
||||||
|
|
|
||||||
|
|
@ -596,7 +596,7 @@ export default class JiaZai extends cc.Component {
|
||||||
private preloadHomePopupPrefabs(): void {
|
private preloadHomePopupPrefabs(): void {
|
||||||
const entries: Array<[string, string, string, number]> = [
|
const entries: Array<[string, string, string, number]> = [
|
||||||
// 第二阶段先准备补发窗口及其图片,成功后才允许开始补发。
|
// 第二阶段先准备补发窗口及其图片,成功后才允许开始补发。
|
||||||
["shop", "prefab/RewardWindow", "cachedRewardPrefab", 2],
|
["publicUI", "prefab/RewardWindow", "cachedRewardPrefab", 2],
|
||||||
["action_bundle", "prefab/newbieGift", "cachedActionPrefab", 1],
|
["action_bundle", "prefab/newbieGift", "cachedActionPrefab", 1],
|
||||||
["shop", "prefab/monthlyCard", "cachedMonthlyCardPrefab", 1],
|
["shop", "prefab/monthlyCard", "cachedMonthlyCardPrefab", 1],
|
||||||
["shop", "prefab/passCheck", "cachedPassCheckPrefab", 1],
|
["shop", "prefab/passCheck", "cachedPassCheckPrefab", 1],
|
||||||
|
|
@ -2193,7 +2193,7 @@ export default class JiaZai extends cc.Component {
|
||||||
|
|
||||||
//打开奖励弹窗
|
//打开奖励弹窗
|
||||||
openRewardWindow(data, month?: number) {
|
openRewardWindow(data, month?: number) {
|
||||||
if (!this.ensureHomePopupPrefab("shop", "prefab/RewardWindow", "cachedRewardPrefab",
|
if (!this.ensureHomePopupPrefab("publicUI", "prefab/RewardWindow", "cachedRewardPrefab",
|
||||||
() => this.openRewardWindow(data, month))) return;
|
() => this.openRewardWindow(data, month))) return;
|
||||||
if (!this.RewardNode) {
|
if (!this.RewardNode) {
|
||||||
// 第一次使用,创建节点
|
// 第一次使用,创建节点
|
||||||
|
|
|
||||||
|
|
@ -890,7 +890,6 @@ export default class SceneManager extends cc.Component {
|
||||||
// 预加载 shop 预制体
|
// 预加载 shop 预制体
|
||||||
SceneManager.clearInvalidShopPrefabCaches();
|
SceneManager.clearInvalidShopPrefabCaches();
|
||||||
if (!SceneManager.cachedShopPrefab
|
if (!SceneManager.cachedShopPrefab
|
||||||
|| !SceneManager.cachedRewardPrefab
|
|
||||||
|| !SceneManager.cachedMonthlyCardPrefab) {
|
|| !SceneManager.cachedMonthlyCardPrefab) {
|
||||||
cc.assetManager.loadBundle('shop', (err: Error, bundle: cc.AssetManager.Bundle) => {
|
cc.assetManager.loadBundle('shop', (err: Error, bundle: cc.AssetManager.Bundle) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -906,15 +905,6 @@ export default class SceneManager extends cc.Component {
|
||||||
SceneManager.cachedShopPrefab = prefab;
|
SceneManager.cachedShopPrefab = prefab;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!SceneManager.cachedRewardPrefab) {
|
|
||||||
bundle.load('prefab/RewardWindow', cc.Prefab, (err: Error, prefab: cc.Prefab) => {
|
|
||||||
if (err) {
|
|
||||||
cc.error(err.message || err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SceneManager.cachedRewardPrefab = prefab;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!SceneManager.cachedMonthlyCardPrefab) {
|
if (!SceneManager.cachedMonthlyCardPrefab) {
|
||||||
bundle.load('prefab/monthlyCard', cc.Prefab, (err: Error, prefab: cc.Prefab) => {
|
bundle.load('prefab/monthlyCard', cc.Prefab, (err: Error, prefab: cc.Prefab) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -926,6 +916,21 @@ export default class SceneManager extends cc.Component {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!SceneManager.cachedRewardPrefab) {
|
||||||
|
cc.assetManager.loadBundle('publicUI', (err: Error, bundle: cc.AssetManager.Bundle) => {
|
||||||
|
if (err) {
|
||||||
|
cc.error(err.message || err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bundle.load('prefab/RewardWindow', cc.Prefab, (err: Error, prefab: cc.Prefab) => {
|
||||||
|
if (err) {
|
||||||
|
cc.error(err.message || err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SceneManager.cachedRewardPrefab = prefab;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
if (!cc.fx.GameTool.isLowMemoryIOSDevice()) {
|
if (!cc.fx.GameTool.isLowMemoryIOSDevice()) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
cc.director.preloadScene("HomeScene", (err) => {
|
cc.director.preloadScene("HomeScene", (err) => {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "1.1.3",
|
|
||||||
"uuid": "6cf5ea5a-e66e-4b12-bb69-bb226ae3cc92",
|
|
||||||
"importer": "folder",
|
|
||||||
"isBundle": false,
|
|
||||||
"bundleName": "",
|
|
||||||
"priority": 1,
|
|
||||||
"compressionType": {},
|
|
||||||
"optimizeHotUpdate": {},
|
|
||||||
"inlineSpriteFrames": {},
|
|
||||||
"isRemoteBundle": {},
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"ver": "1.1.3",
|
"ver": "1.1.3",
|
||||||
"uuid": "d6f6519f-68f0-43ab-a8b1-3194fce85a6f",
|
"uuid": "10b8da17-1df3-40d3-8e0c-401e860d2e58",
|
||||||
"importer": "folder",
|
"importer": "folder",
|
||||||
"isBundle": false,
|
"isBundle": false,
|
||||||
"bundleName": "",
|
"bundleName": "",
|
||||||
|
|
@ -305,8 +305,8 @@
|
||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 86,
|
"width": 84,
|
||||||
"height": 98
|
"height": 95
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
|
@ -358,7 +358,7 @@
|
||||||
"_srcBlendFactor": 770,
|
"_srcBlendFactor": 770,
|
||||||
"_dstBlendFactor": 771,
|
"_dstBlendFactor": 771,
|
||||||
"_spriteFrame": {
|
"_spriteFrame": {
|
||||||
"__uuid__": "b94c323b-3d26-4684-ba64-0f00a13438d2"
|
"__uuid__": "d22678f9-a73b-4c94-af07-62a134fd2d30"
|
||||||
},
|
},
|
||||||
"_type": 0,
|
"_type": 0,
|
||||||
"_sizeMode": 1,
|
"_sizeMode": 1,
|
||||||
|
|
@ -371,9 +371,7 @@
|
||||||
"_fillStart": 0,
|
"_fillStart": 0,
|
||||||
"_fillRange": 0,
|
"_fillRange": 0,
|
||||||
"_isTrimmedMode": true,
|
"_isTrimmedMode": true,
|
||||||
"_atlas": {
|
"_atlas": null,
|
||||||
"__uuid__": "52d3eb5b-948f-403a-aafa-1c8f1a40a8c8"
|
|
||||||
},
|
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1180,8 +1178,8 @@
|
||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 86,
|
"width": 106,
|
||||||
"height": 98
|
"height": 122
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
|
|
@ -1233,7 +1231,7 @@
|
||||||
"_srcBlendFactor": 770,
|
"_srcBlendFactor": 770,
|
||||||
"_dstBlendFactor": 771,
|
"_dstBlendFactor": 771,
|
||||||
"_spriteFrame": {
|
"_spriteFrame": {
|
||||||
"__uuid__": "24adad9c-1a33-44bd-b471-d615817acdb1"
|
"__uuid__": "73a886ef-de32-4216-8f4d-70d7144b011c"
|
||||||
},
|
},
|
||||||
"_type": 0,
|
"_type": 0,
|
||||||
"_sizeMode": 1,
|
"_sizeMode": 1,
|
||||||
|
|
@ -1246,9 +1244,7 @@
|
||||||
"_fillStart": 0,
|
"_fillStart": 0,
|
||||||
"_fillRange": 0,
|
"_fillRange": 0,
|
||||||
"_isTrimmedMode": true,
|
"_isTrimmedMode": true,
|
||||||
"_atlas": {
|
"_atlas": null,
|
||||||
"__uuid__": "52d3eb5b-948f-403a-aafa-1c8f1a40a8c8"
|
|
||||||
},
|
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
BIN
assets/publicUI/yaoshi.png
Normal file
BIN
assets/publicUI/yaoshi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
38
assets/publicUI/yaoshi.png.meta
Normal file
38
assets/publicUI/yaoshi.png.meta
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"ver": "2.3.7",
|
||||||
|
"uuid": "ba72c4e9-3ba4-4330-9efe-aedc99789d34",
|
||||||
|
"importer": "texture",
|
||||||
|
"type": "sprite",
|
||||||
|
"wrapMode": "clamp",
|
||||||
|
"filterMode": "bilinear",
|
||||||
|
"premultiplyAlpha": false,
|
||||||
|
"genMipmaps": false,
|
||||||
|
"packable": true,
|
||||||
|
"width": 106,
|
||||||
|
"height": 122,
|
||||||
|
"platformSettings": {},
|
||||||
|
"subMetas": {
|
||||||
|
"yaoshi": {
|
||||||
|
"ver": "1.0.6",
|
||||||
|
"uuid": "73a886ef-de32-4216-8f4d-70d7144b011c",
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"rawTextureUuid": "ba72c4e9-3ba4-4330-9efe-aedc99789d34",
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 0,
|
||||||
|
"trimY": 0,
|
||||||
|
"width": 106,
|
||||||
|
"height": 122,
|
||||||
|
"rawWidth": 106,
|
||||||
|
"rawHeight": 122,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "1.1.3",
|
|
||||||
"uuid": "5d6b428c-f644-41df-b3c7-2e63b9609538",
|
|
||||||
"importer": "folder",
|
|
||||||
"isBundle": false,
|
|
||||||
"bundleName": "",
|
|
||||||
"priority": 1,
|
|
||||||
"compressionType": {},
|
|
||||||
"optimizeHotUpdate": {},
|
|
||||||
"inlineSpriteFrames": {},
|
|
||||||
"isRemoteBundle": {},
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "1.1.3",
|
|
||||||
"uuid": "2ed0f367-e2cc-40a0-8d17-b64fae553330",
|
|
||||||
"importer": "folder",
|
|
||||||
"isBundle": false,
|
|
||||||
"bundleName": "",
|
|
||||||
"priority": 1,
|
|
||||||
"compressionType": {},
|
|
||||||
"optimizeHotUpdate": {},
|
|
||||||
"inlineSpriteFrames": {},
|
|
||||||
"isRemoteBundle": {},
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"ver": "1.1.3",
|
|
||||||
"uuid": "3e2b9e78-1f47-4725-8f09-bb8491cd05d0",
|
|
||||||
"importer": "folder",
|
|
||||||
"isBundle": false,
|
|
||||||
"bundleName": "",
|
|
||||||
"priority": 1,
|
|
||||||
"compressionType": {},
|
|
||||||
"optimizeHotUpdate": {},
|
|
||||||
"inlineSpriteFrames": {},
|
|
||||||
"isRemoteBundle": {},
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user