Commit a6b50d4b authored by AU-Pro-mac's avatar AU-Pro-mac

add new code --17

parent 6e3f083e
......@@ -1685,40 +1685,6 @@ const resCanvasListCsd = {
/***/ }),
/***/ "./resLottieList.js":
/*!**************************!*\
!*** ./resLottieList.js ***!
\**************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _resCanvasList__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./resCanvasList */ "./resCanvasList.js");
const resLottieList = {
// "blueCat":{
// imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
// json:BlueCatTexture
// },
// "orengeCat":{
// imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url,
// json:OrengeCatTexture
// },
// "sanhuaCat":{
// imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url,
// json:SanhuaCatTexture
// },
// "xianluoCat":{
// imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url,
// json:XianluoCatTexture
// }
}
/* harmony default export */ __webpack_exports__["default"] = (resLottieList);
/***/ }),
/***/ "./src/Ins.ts":
/*!********************!*\
!*** ./src/Ins.ts ***!
......@@ -1830,15 +1796,14 @@ var resCanvasListCsd_1 = __webpack_require__(/*! ../resCanvasListCsd */ "./resCa
var lottieTexture = __webpack_require__(/*! ./openAnimation/Texture.json */ "./src/openAnimation/Texture.json");
var lottieTextureCsd_smoke = __webpack_require__(/*! ./chuansongdai/lottie/smoke/smokeTexture.json */ "./src/chuansongdai/lottie/smoke/smokeTexture.json");
var lottieTextureCsd_light = __webpack_require__(/*! ./chuansongdai/lottie/light/lightTexture.json */ "./src/chuansongdai/lottie/light/lightTexture.json");
var resLottieList_1 = __webpack_require__(/*! ../resLottieList */ "./resLottieList.js");
var Ins_1 = __webpack_require__(/*! ./Ins */ "./src/Ins.ts");
var initLottie_1 = __webpack_require__(/*! ./initLottie */ "./src/initLottie.ts");
var XxlScene_1 = __webpack_require__(/*! ./xiaoxiaole/XxlScene */ "./src/xiaoxiaole/XxlScene.ts");
var MainScene_1 = __webpack_require__(/*! ./chuansongdai/MainScene */ "./src/chuansongdai/MainScene.ts");
var MainScene_2 = __webpack_require__(/*! ./openAnimation/MainScene */ "./src/openAnimation/MainScene.ts");
exports.GDispatcher = new FYGE.EventDispatcher();
var Main = (function () {
function Main(canvas) {
console.time('main.ts constructor');
console.warn = function () { };
var sysInfo;
if (my) {
......@@ -1858,6 +1823,21 @@ var Main = (function () {
self.requestID = FYGE.getRequestAnimationFrame()(loop);
}
}
Main.prototype.loadLottieFasterAndFaster = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTextures(resCanvasList_1.default)];
case 1:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
console.timeEnd('main.ts constructor');
return [2];
}
});
});
};
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
......@@ -1913,27 +1893,15 @@ var Main = (function () {
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
return [4, this.loadLottieFasterAndFaster()];
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 4:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
ctrls_1.changeScene(MainScene_2.OpenAni);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 5:
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
case 2:
_a.sent();
console.log("initLottieList完成");
console.log('resloadingList 加载完毕');
FYGE.GDispatcher.dispatchEvent("loadEnd");
return [2];
}
......@@ -5364,69 +5332,6 @@ var G_EVENT;
})(G_EVENT = exports.G_EVENT || (exports.G_EVENT = {}));
/***/ }),
/***/ "./src/initLottie.ts":
/*!***************************!*\
!*** ./src/initLottie.ts ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitLottie = void 0;
var InitLottie;
(function (InitLottie) {
function initLottieList(resList) {
console.log("开始加载lottie资源");
var list = [];
for (var key in resList) {
list.push(resList[key]);
}
console.log(list);
var p = new Promise(function (resolve, reject) {
initLottie(function (s) {
if (s) {
resolve();
}
else {
reject();
}
}, list);
});
return p;
}
InitLottie.initLottieList = initLottieList;
function initLottie(callback, arr) {
var count = 0;
var countAll = arr.length;
console.log(countAll);
if (!countAll)
callback(true);
var mark = true;
var _loop_1 = function (i) {
var textureJson = arr[i].json;
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), textureJson);
}
else {
mark = false;
}
if (++count == countAll)
callback(mark);
}, arr[i]["imgUrl"]);
};
for (var i = 0; i < countAll; i++) {
_loop_1(i);
}
}
InitLottie.initLottie = initLottie;
})(InitLottie = exports.InitLottie || (exports.InitLottie = {}));
/***/ }),
/***/ "./src/openAnimation/MainScene.ts":
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1687,40 +1687,6 @@ const resCanvasListCsd = {
/***/ }),
/***/ "./resLottieList.js":
/*!**************************!*\
!*** ./resLottieList.js ***!
\**************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _resCanvasList__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./resCanvasList */ "./resCanvasList.js");
const resLottieList = {
// "blueCat":{
// imgUrl:resCanvasList["a7dc39fa-5f6d-4e94-8979-81c4a4aa183f"].url,
// json:BlueCatTexture
// },
// "orengeCat":{
// imgUrl:resCanvasList["72987d74-2fa7-49b9-865d-a0d80c6ed220"].url,
// json:OrengeCatTexture
// },
// "sanhuaCat":{
// imgUrl:resCanvasList["75320997-b466-4161-abab-b03a51ec522b"].url,
// json:SanhuaCatTexture
// },
// "xianluoCat":{
// imgUrl:resCanvasList["de2d1dca-ed1c-4fe0-93ef-684f4b96c87e"].url,
// json:XianluoCatTexture
// }
}
/* harmony default export */ __webpack_exports__["default"] = (resLottieList);
/***/ }),
/***/ "./src/Ins.ts":
/*!********************!*\
!*** ./src/Ins.ts ***!
......@@ -1832,15 +1798,14 @@ var resCanvasListCsd_1 = __webpack_require__(/*! ../resCanvasListCsd */ "./resCa
var lottieTexture = __webpack_require__(/*! ./openAnimation/Texture.json */ "./src/openAnimation/Texture.json");
var lottieTextureCsd_smoke = __webpack_require__(/*! ./chuansongdai/lottie/smoke/smokeTexture.json */ "./src/chuansongdai/lottie/smoke/smokeTexture.json");
var lottieTextureCsd_light = __webpack_require__(/*! ./chuansongdai/lottie/light/lightTexture.json */ "./src/chuansongdai/lottie/light/lightTexture.json");
var resLottieList_1 = __webpack_require__(/*! ../resLottieList */ "./resLottieList.js");
var Ins_1 = __webpack_require__(/*! ./Ins */ "./src/Ins.ts");
var initLottie_1 = __webpack_require__(/*! ./initLottie */ "./src/initLottie.ts");
var XxlScene_1 = __webpack_require__(/*! ./xiaoxiaole/XxlScene */ "./src/xiaoxiaole/XxlScene.ts");
var MainScene_1 = __webpack_require__(/*! ./chuansongdai/MainScene */ "./src/chuansongdai/MainScene.ts");
var MainScene_2 = __webpack_require__(/*! ./openAnimation/MainScene */ "./src/openAnimation/MainScene.ts");
exports.GDispatcher = new FYGE.EventDispatcher();
var Main = (function () {
function Main(canvas) {
console.time('main.ts constructor');
console.warn = function () { };
var sysInfo;
if (my) {
......@@ -1860,6 +1825,21 @@ var Main = (function () {
self.requestID = FYGE.getRequestAnimationFrame()(loop);
}
}
Main.prototype.loadLottieFasterAndFaster = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, this.loadImageTextures(resCanvasList_1.default)];
case 1:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
console.timeEnd('main.ts constructor');
return [2];
}
});
});
};
Main.prototype.changeGameSence = function (gameType) {
this.gameType = gameType;
console.log('changeGameSence');
......@@ -1915,27 +1895,15 @@ var Main = (function () {
Ins_1.Ins.stageW = this.stage.viewRect.width;
Ins_1.Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:", Ins_1.Ins.stageW, Ins_1.Ins.stageH);
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
return [4, this.loadLottieFasterAndFaster()];
case 1:
_a.sent();
console.log('resloadingList 加载完毕');
return [4, this.loadImageTextures(resCanvasList)];
case 2:
_a.sent();
return [4, this.loadImageTexturesCsd01(resCanvasList)];
case 3:
_a.sent();
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 4:
_a.sent();
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;');
ctrls_1.changeScene(MainScene_2.OpenAni);
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.onload, {});
return [4, initLottie_1.InitLottie.initLottieList(resLottieList_1.default)];
case 5:
resCanvasList = Object.assign(resCanvasList_1.default, resCanvasListCsd_1.default);
return [4, RES_1.RES.loadSparkAssets(resCanvasList)];
case 2:
_a.sent();
console.log("initLottieList完成");
console.log('resloadingList 加载完毕');
FYGE.GDispatcher.dispatchEvent("loadEnd");
return [2];
}
......@@ -5366,69 +5334,6 @@ var G_EVENT;
})(G_EVENT = exports.G_EVENT || (exports.G_EVENT = {}));
/***/ }),
/***/ "./src/initLottie.ts":
/*!***************************!*\
!*** ./src/initLottie.ts ***!
\***************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitLottie = void 0;
var InitLottie;
(function (InitLottie) {
function initLottieList(resList) {
console.log("开始加载lottie资源");
var list = [];
for (var key in resList) {
list.push(resList[key]);
}
console.log(list);
var p = new Promise(function (resolve, reject) {
initLottie(function (s) {
if (s) {
resolve();
}
else {
reject();
}
}, list);
});
return p;
}
InitLottie.initLottieList = initLottieList;
function initLottie(callback, arr) {
var count = 0;
var countAll = arr.length;
console.log(countAll);
if (!countAll)
callback(true);
var mark = true;
var _loop_1 = function (i) {
var textureJson = arr[i].json;
FYGE.GlobalLoader.loadImage(function (s, image) {
if (s) {
FYGE.createTextureSheet(new FYGE.BaseTexture(image), textureJson);
}
else {
mark = false;
}
if (++count == countAll)
callback(mark);
}, arr[i]["imgUrl"]);
};
for (var i = 0; i < countAll; i++) {
_loop_1(i);
}
}
InitLottie.initLottie = initLottie;
})(InitLottie = exports.InitLottie || (exports.InitLottie = {}));
/***/ }),
/***/ "./src/openAnimation/MainScene.ts":
......
......@@ -84,6 +84,13 @@ export class Main {
}
}
// 尽快加载完
async loadLottieFasterAndFaster () {
await this.loadImageTextures(resCanvasList_)
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
sendTbNet(TbNetName.onload, {})
}
// 切换游戏
changeGameSence(gameType) {
this.gameType = gameType
......@@ -152,23 +159,15 @@ export class Main {
Ins.stageH = this.stage.viewRect.height;
console.log("舞台宽高:", Ins.stageW, Ins.stageH)
let resCanvasList = Object.assign(resCanvasList_, resCanvasListCsd)
// changeScene(CsdScene)
// changeScene(XxlScene)
await this.loadLottieFasterAndFaster()
changeScene(OpenAni)
let resCanvasList = Object.assign(resCanvasList_, resCanvasListCsd)
await RES.loadSparkAssets(resCanvasList)
console.log('resloadingList 加载完毕')
await this.loadImageTextures(resCanvasList)
await this.loadImageTexturesCsd01(resCanvasList)
await this.loadImageTexturesCsd02(resCanvasList)
console.log('%cloadImageTextures over', 'color:red;font-weight:bold;font-size:16px;padding: 4px 20px;')
changeScene(OpenAni)
// changeScene(CsdScene)
// changeScene(XxlScene)
sendTbNet(TbNetName.onload, {})
await InitLottie.initLottieList(resLottieList);
console.log("initLottieList完成")
FYGE.GDispatcher.dispatchEvent("loadEnd");
// showPanel(NoStepPanel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment