no message
This commit is contained in:
@@ -20,36 +20,59 @@ export function getUnityCdnBuildRoot() {
|
|||||||
return `${getUnityCdnRoot()}/Build`;
|
return `${getUnityCdnRoot()}/Build`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 预取关卡库并注入,避免 LevelDatabase 回退到 /unity/ 或 editor 相对路径 */
|
async function fetchJsonWithBrotli(jsonUrl) {
|
||||||
export async function prefetchLevelsDatabase(cdnRoot) {
|
|
||||||
const root = String(cdnRoot || getUnityCdnRoot()).replace(/\/$/, '');
|
|
||||||
const jsonUrl = `${root}/levels-database.json`;
|
|
||||||
window.__tfrhLevelsDatabaseUrl = jsonUrl;
|
|
||||||
|
|
||||||
if (window.__tfrhLevelsDatabaseJson) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const brUrl = jsonUrl.replace(/\.json(\?.*)?$/i, '.json.br$1');
|
const brUrl = jsonUrl.replace(/\.json(\?.*)?$/i, '.json.br$1');
|
||||||
|
|
||||||
if (typeof DecompressionStream !== 'undefined') {
|
if (typeof DecompressionStream !== 'undefined') {
|
||||||
try {
|
try {
|
||||||
const brRes = await fetch(brUrl);
|
const brRes = await fetch(brUrl);
|
||||||
if (brRes.ok) {
|
if (brRes.ok) {
|
||||||
const text = await new Response(await brRes.arrayBuffer())
|
const ab = await brRes.arrayBuffer();
|
||||||
.pipeThrough(new DecompressionStream('brotli'))
|
let text = new TextDecoder().decode(ab);
|
||||||
.text();
|
if (text.charCodeAt(0) !== 0x7b && text.charCodeAt(0) !== 0x5b) {
|
||||||
window.__tfrhLevelsDatabaseJson = JSON.parse(text);
|
text = await new Response(ab)
|
||||||
return;
|
.pipeThrough(new DecompressionStream('brotli'))
|
||||||
|
.text();
|
||||||
|
}
|
||||||
|
return JSON.parse(text);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('[unity-cdn] levels-database.json.br 预取失败,尝试 .json', e);
|
console.warn('[unity-cdn] Brotli 预取失败,尝试 .json', jsonUrl, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await fetch(jsonUrl);
|
const res = await fetch(jsonUrl);
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
throw new Error(`levels-database HTTP ${res.status}: ${jsonUrl}`);
|
throw new Error(`HTTP ${res.status}: ${jsonUrl}`);
|
||||||
}
|
}
|
||||||
window.__tfrhLevelsDatabaseJson = await res.json();
|
return res.json();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 首屏只预取关卡库索引(分片模式);legacy 全量库作回退 URL */
|
||||||
|
export async function prefetchLevelsDatabase(cdnRoot) {
|
||||||
|
const root = String(cdnRoot || getUnityCdnRoot()).replace(/\/$/, '');
|
||||||
|
const indexUrl = `${root}/levels-db-index.json`;
|
||||||
|
const jsonUrl = `${root}/levels-database.json`;
|
||||||
|
window.__tfrhLevelsDbIndexUrl = indexUrl;
|
||||||
|
window.__tfrhLevelsDatabaseUrl = jsonUrl;
|
||||||
|
|
||||||
|
if (window.__tfrhLevelsDbIndex) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const index = await fetchJsonWithBrotli(indexUrl);
|
||||||
|
if (index?.mode === 'sharded' && index.shards?.length) {
|
||||||
|
window.__tfrhLevelsDbIndex = index;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('[unity-cdn] levels-db-index 预取失败,启动时将回退全量库', e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.__tfrhLevelsDatabaseJson) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.__tfrhLevelsDatabaseJson = await fetchJsonWithBrotli(jsonUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,15 +167,15 @@ const CONFIG = {
|
|||||||
version: "20260520",
|
version: "20260520",
|
||||||
|
|
||||||
/** OSS 真实地址(生产环境浏览器直连) */
|
/** OSS 真实地址(生产环境浏览器直连) */
|
||||||
unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260616',
|
unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
|
||||||
/** 方案 B:nginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false) */
|
/** 方案 B:nginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false) */
|
||||||
unityCdnDevProxy: '/cdn-unity',
|
unityCdnDevProxy: '/cdn-unity',
|
||||||
/** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */
|
/** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */
|
||||||
unityCdnUseDevProxy: false,
|
unityCdnUseDevProxy: false,
|
||||||
/** 生产 nginx 反向代理 OSS 同路径时设为 true(方案 B) */
|
/** 生产 nginx 反向代理 OSS 同路径时设为 true(方案 B) */
|
||||||
unityCdnUseSiteProxy: false,
|
unityCdnUseSiteProxy: false,
|
||||||
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260616',
|
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
|
||||||
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260616/Build',
|
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260617/Build',
|
||||||
python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/',
|
python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/',
|
||||||
|
|
||||||
// 可以根据需要添加其他配置
|
// 可以根据需要添加其他配置
|
||||||
|
|||||||
BIN
scratch-gui/static/unity/Build/mstest5.data.br
Normal file
BIN
scratch-gui/static/unity/Build/mstest5.data.br
Normal file
Binary file not shown.
BIN
scratch-gui/static/unity/Build/mstest5.framework.js.br
Normal file
BIN
scratch-gui/static/unity/Build/mstest5.framework.js.br
Normal file
Binary file not shown.
1623
scratch-gui/static/unity/Build/mstest5.loader.js
Normal file
1623
scratch-gui/static/unity/Build/mstest5.loader.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
scratch-gui/static/unity/Build/mstest5.wasm.br
Normal file
BIN
scratch-gui/static/unity/Build/mstest5.wasm.br
Normal file
Binary file not shown.
@@ -0,0 +1,126 @@
|
|||||||
|
<linker>
|
||||||
|
<assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="AudioManager" preserve="all" />
|
||||||
|
<type fullname="Platformer.Controller.PlayerController" preserve="all" />
|
||||||
|
<type fullname="Platformer.Controller.PropController" preserve="all" />
|
||||||
|
<type fullname="Platformer.Controller.VehicleController" preserve="all" />
|
||||||
|
<type fullname="Platformer.Controller.ViewController" preserve="all" />
|
||||||
|
<type fullname="Platformer.Core.Health" preserve="all" />
|
||||||
|
<type fullname="Platformer.Core.UI.ButtonHandler" preserve="all" />
|
||||||
|
<type fullname="Platformer.Gameplay.LineGridRenderer" preserve="all" />
|
||||||
|
<type fullname="Platformer.Manager.GameManager" preserve="all" />
|
||||||
|
<type fullname="PopupController" preserve="all" />
|
||||||
|
<type fullname="SkinDialog" preserve="all" />
|
||||||
|
<type fullname="SkinItem" preserve="all" />
|
||||||
|
<type fullname="UIMain" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||||
|
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
||||||
|
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="TMPro.TextMeshPro" preserve="all" />
|
||||||
|
<type fullname="TMPro.TextMeshProUGUI" preserve="all" />
|
||||||
|
<type fullname="TMPro.TMP_FontAsset" preserve="all" />
|
||||||
|
<type fullname="TMPro.FaceInfo_Legacy" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.FontAssetCreationSettings" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.KerningTable" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.TMP_Character" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.TMP_FontFeatureTable" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.TMP_FontWeightPair" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.TMP_GlyphAdjustmentRecord" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.TMP_GlyphPairAdjustmentRecord" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.TMP_GlyphValueRecord" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="TMPro.VertexGradient" preserve="nothing" serialized="true" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEditor.Audio.AudioMixerSnapshotController" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.AnimationClip" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Animator" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.AnimatorOverrideController" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.RuntimeAnimatorController" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.Audio.AudioMixer" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Audio.AudioMixerGroup" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.AudioClip" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.AudioListener" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.AudioSource" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.Camera" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.GameObject" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.LightmapSettings" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.LineRenderer" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Material" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.MeshRenderer" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Object" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.RectTransform" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Rendering.SortingGroup" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.RenderSettings" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Shader" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Sprite" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.SpriteRenderer" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Texture2D" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Transform" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.U2D.SpriteAtlas" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Events.PersistentCallGroup" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.RectOffset" preserve="nothing" serialized="true" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.GridModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.Grid" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.Physics2DModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.BoxCollider2D" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Rigidbody2D" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.Font" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.TilemapModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.Tilemaps.Tile" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Tilemaps.Tilemap" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.Tilemaps.TilemapRenderer" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.EventSystems.EventSystem" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.EventSystems.StandaloneInputModule" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.Button" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.CanvasScaler" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.ContentSizeFitter" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.GraphicRaycaster" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.GridLayoutGroup" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.Image" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.Mask" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.Scrollbar" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.ScrollRect" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.VerticalLayoutGroup" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.UI.AnimationTriggers" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.UI.Button/ButtonClickedEvent" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.UI.ColorBlock" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.UI.MaskableGraphic/CullStateChangedEvent" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.UI.Navigation" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.UI.ScrollRect/ScrollRectEvent" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.UI.Scrollbar/ScrollEvent" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.UI.SpriteState" preserve="nothing" serialized="true" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
|
<type fullname="UnityEngine.Canvas" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.CanvasGroup" preserve="all" />
|
||||||
|
<type fullname="UnityEngine.CanvasRenderer" preserve="all" />
|
||||||
|
</assembly>
|
||||||
|
<assembly fullname="UnityEngine.TextCoreFontEngineModule">
|
||||||
|
<type fullname="UnityEngine.TextCore.FaceInfo" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.TextCore.Glyph" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.TextCore.GlyphMetrics" preserve="nothing" serialized="true" />
|
||||||
|
<type fullname="UnityEngine.TextCore.GlyphRect" preserve="nothing" serialized="true" />
|
||||||
|
</assembly>
|
||||||
|
</linker>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user