Commit bae28827 authored by 范雪寒's avatar 范雪寒

feat: onCourseInScreen

parent 2d17c4ad
......@@ -5,6 +5,12 @@
/publish/publish/play
/publish/publish/form
/publish/publish/android
/publish/publish/web_desktop
/publish/publish/ios
/publish/publish/*.zip
/publish/publish/config.json
/publish/publish/Release*
/node_modules
/play/build_android
/play/build_ios
/play/build_web_desktop
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"isBundle": true,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"isRemoteBundle": {
"ios": true,
"android": true
},
"subMetas": {}
}
\ No newline at end of file
......@@ -64,7 +64,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"_id": "57ea7c61-9b8b-498a-b024-c98ee9124beb"
"_id": "074720a3-f261-4ae9-9af1-1adabd8f4c6d"
},
{
"__type__": "cc.Node",
......@@ -1477,14 +1477,14 @@
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "f4edeRi+NdAabqAkVYRwFjK",
"__type__": "0e7205TFJ1Pjogb2tsB2COD",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "e687yyoRBIzZAOVRL8Sseh"
"_id": "4e8924f57e1b4c17861ac7"
},
{
"__type__": "cc.Node",
......
{
"ver": "1.2.9",
"uuid": "57ea7c61-9b8b-498a-b024-c98ee9124beb",
"uuid": "074720a3-f261-4ae9-9af1-1adabd8f4c6d",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"subMetas": {}
......
......@@ -121,18 +121,23 @@ cc.Class({
},
preload() {
const preloadArr = [
...this._imageResList,
...this._audioResList,
...this._animaResList
];
cc.assetManager.loadAny(preloadArr, null, null, (err, data) => {
this.loadEnd();
if (window && window["air"]) {
window["air"].hideAirClassLoading();
cc.find('Canvas').opacity = 0;
window.air.onCourseInScreen = (next) => {
cc.find('Canvas').opacity = 255;
this.loadEnd();
next();
}
window.air.hideAirClassLoading();
} else {
this.loadEnd();
}
cc.debug.setDisplayStats(false);
......
{
"ver": "1.0.8",
"uuid": "f4ede462-f8d7-4069-ba80-915611c058ca",
"uuid": "0e720e53-149d-4f8e-881b-dadb01d82383",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
......@@ -3,6 +3,6 @@
"packages": "packages",
"name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.5",
"version": "2.4.4",
"isNew": false
}
\ No newline at end of file
{
"title": "play",
"packageName": "org.cocos2d.demo",
"startScene": "57ea7c61-9b8b-498a-b024-c98ee9124beb",
"startScene": "074720a3-f261-4ae9-9af1-1adabd8f4c6d",
"excludeScenes": [],
"includeSDKBox": false,
"orientation": {
......
let fs = require('fs');
const fs = require('fs');
const { v4, parse } = require('uuid');
const { Base64 } = require('js-base64');
const path = '../play/assets'
let folderName = '';
fs.readdirSync(path).find(fileName => {
function getFolderName(path) {
let folderName = '';
fs.readdirSync(path).find(fileName => {
const st = fs.statSync(`${path}/${fileName}`);
if (st.isDirectory()) {
folderName = fileName;
}
});
const metaPath = `${path}/${folderName}.meta`;
const metaDataStr = fs.readFileSync(metaPath);
const metaData = JSON.parse(metaDataStr);
metaData.isBundle = false;
fs.writeFileSync(metaPath, JSON.stringify(metaData));
});
return folderName;
}
function editFolderMeta(path, folderName) {
const metaPath = `${path}/${folderName}.meta`;
const metaDataStr = fs.readFileSync(metaPath);
const metaData = JSON.parse(metaDataStr);
metaData.isBundle = false;
fs.writeFileSync(metaPath, JSON.stringify(metaData));
}
function fileReplace(path, replaceStr, newStr) {
const fileStr = fs.readFileSync(path);
const newFileStr = fileStr.toString().replace(replaceStr, newStr);
fs.writeFileSync(path, newFileStr);
}
const path = '../play/assets'
const folderName = getFolderName(path);
editFolderMeta(path, folderName);
const oldFireUuid = '57ea7c61-9b8b-498a-b024-c98ee9124beb';
const newFireUuid = v4();
fileReplace(`../play/assets/${folderName}/scene/${folderName}.fire.meta`, oldFireUuid, newFireUuid);
fileReplace(`../play/assets/${folderName}/scene/${folderName}.fire`, oldFireUuid, newFireUuid);
fileReplace('../play/settings/builder.json', oldFireUuid, newFireUuid);
function getShortUuid(uuid) {
const bytes = parse(uuid).subarray(1);
return uuid.substring(0, 5) + Base64.fromUint8Array(bytes).substring(2);
}
const oldJsUuid = 'f4ede462-f8d7-4069-ba80-915611c058ca';
const oldJsShortUuid = 'f4edeRi+NdAabqAkVYRwFjK';
const oldJsId = 'e687yyoRBIzZAOVRL8Sseh';
const newJsUuid = v4();
const newJsShortUuid = getShortUuid(newJsUuid);
const newJsId = v4().replace(/-/g, '').substring(0, oldJsId.length);
fileReplace(`../play/assets/${folderName}/scene/${folderName}.js.meta`, oldJsUuid, newJsUuid);
fileReplace(`../play/assets/${folderName}/scene/${folderName}.fire`, oldFireUuid, newFireUuid);
fileReplace(`../play/assets/${folderName}/scene/${folderName}.fire`, oldJsShortUuid, newJsShortUuid);
fileReplace(`../play/assets/${folderName}/scene/${folderName}.fire`, oldJsId, newJsId);
......@@ -4,6 +4,11 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"base-64": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz",
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
},
"bl": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz",
......@@ -107,6 +112,11 @@
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"js-base64": {
"version": "3.7.2",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz",
"integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ=="
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
......@@ -222,6 +232,11 @@
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
......
......@@ -9,6 +9,9 @@
"author": "",
"license": "ISC",
"dependencies": {
"compressing": "^1.5.1"
"base-64": "^1.0.0",
"compressing": "^1.5.1",
"js-base64": "^3.7.2",
"uuid": "^8.3.2"
}
}
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