```
feat: 移除自适应性能相关配置并调整动画控制器 移除了Unity自适应性能(Adaptive Performance)的相关配置文件, 包括Adaptive Performance文件夹及其子目录中的所有配置文件, 同时移除了移动通知(NotificationSettings)相关配置, 以及第一章第一关(level_chapter1_level1)的关卡配置文件, 还删除了多个材质文件如AdjustableGlowOrb、AdjustableGlowOrbHalo 和Arena相关材质。另外微调了base-人类士兵.controller中状态机 的位置坐标,将x坐标从320调整为330。 ```
This commit is contained in:
1 parent
13d0c80335
commit
f77fa20f82
413 files changed
+13494
-63858
No files matched your search
@@ -0,0 +1,80 @@
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 微信小游戏包体精简工具。
|
||||
///
|
||||
/// 背景:微信 SDK 在转换时会强制把 PlayerSettings 的 debugSymbolMode 设为 External
|
||||
/// (见 WXConvertCore.Init),于是每次转换都会把
|
||||
/// webgl.wasm.symbols.unityweb(约 10MB)及其 .br 副本写进 minigame 代码包的主包目录。
|
||||
/// 该文件只用于代码分包的增量更新,对首包运行没有作用,但会显著撑大主包体积。
|
||||
///
|
||||
/// 用法:用菜单「微信小游戏 / 转换小游戏(精简包体)」代替 SDK 自带的转换菜单,
|
||||
/// 转换成功后会立即删除上述符号文件。已经转换过则用「清理代码包调试符号」单独清理。
|
||||
///
|
||||
/// 代价:代码分包失去增量更新能力,后续发版用户需要重新下载完整 wasm。
|
||||
/// </summary>
|
||||
public static class WeChatPackageOptimizer
|
||||
{
|
||||
const string ConfigPath = "Assets/WX-WASM-SDK-V2/Editor/MiniGameConfig.asset";
|
||||
|
||||
static readonly string[] SymbolFiles =
|
||||
{
|
||||
"minigame/webgl.wasm.symbols.unityweb",
|
||||
"minigame/webgl.wasm.symbols.unityweb.br",
|
||||
};
|
||||
|
||||
[MenuItem("微信小游戏 / 转换小游戏(精简包体)", false, 0)]
|
||||
public static void ConvertAndSlim()
|
||||
{
|
||||
var result = WeChatWASM.WXConvertCore.DoExport(true);
|
||||
if (result != WeChatWASM.WXConvertCore.WXExportError.SUCCEED)
|
||||
{
|
||||
Debug.LogError("[精简包体] 转换失败:" + result);
|
||||
return;
|
||||
}
|
||||
CleanSymbols();
|
||||
}
|
||||
|
||||
[MenuItem("微信小游戏 / 清理代码包调试符号", false, 20)]
|
||||
public static void CleanSymbols()
|
||||
{
|
||||
var dst = GetDst();
|
||||
if (string.IsNullOrEmpty(dst))
|
||||
{
|
||||
Debug.LogError("[精简包体] 未能在 " + ConfigPath + " 中读到 ProjectConf.DST");
|
||||
return;
|
||||
}
|
||||
|
||||
long freed = 0;
|
||||
foreach (var rel in SymbolFiles)
|
||||
{
|
||||
var path = Path.Combine(dst, rel);
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
Debug.Log("[精简包体] 不存在,跳过:" + path);
|
||||
continue;
|
||||
}
|
||||
freed += new FileInfo(path).Length;
|
||||
File.Delete(path);
|
||||
Debug.Log("[精简包体] 已删除 " + path);
|
||||
}
|
||||
|
||||
Debug.Log(string.Format("[精简包体] 完成,释放 {0:F1} MB({1})。请到微信开发者工具重新上传。",
|
||||
freed / 1048576.0, dst));
|
||||
}
|
||||
|
||||
static string GetDst()
|
||||
{
|
||||
var asset = AssetDatabase.LoadAssetAtPath<Object>(ConfigPath);
|
||||
if (asset == null) return null;
|
||||
|
||||
var so = new SerializedObject(asset);
|
||||
var dst = so.FindProperty("ProjectConf.DST");
|
||||
if (dst != null && !string.IsNullOrEmpty(dst.stringValue)) return dst.stringValue;
|
||||
|
||||
var relative = so.FindProperty("ProjectConf.relativeDST");
|
||||
return relative != null && !string.IsNullOrEmpty(relative.stringValue) ? relative.stringValue : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: CHgW5ir8Un9//MPkiytI/UaL9UV08HgYVs70/Xlf3AHIpScI0O/Fayk=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d8e2e3178665be488e481c57be9527e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,42 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:yousandi.cn,2023:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0863bf92b4fcc45b0b9267325249bf0f, type: 3}
|
||||
m_Name: NotificationSettings
|
||||
m_EditorClassIdentifier:
|
||||
toolbarInt: 0
|
||||
iOSNotificationEditorSettingsValues:
|
||||
keys:
|
||||
- UnityNotificationRequestAuthorizationOnAppLaunch
|
||||
- UnityNotificationDefaultAuthorizationOptions
|
||||
- UnityAddRemoteNotificationCapability
|
||||
- UnityNotificationRequestAuthorizationForRemoteNotificationsOnAppLaunch
|
||||
- UnityRemoteNotificationForegroundPresentationOptions
|
||||
- UnityUseAPSReleaseEnvironment
|
||||
- UnityUseLocationNotificationTrigger
|
||||
values:
|
||||
- True
|
||||
- 7
|
||||
- False
|
||||
- False
|
||||
- -1
|
||||
- False
|
||||
- False
|
||||
AndroidNotificationEditorSettingsValues:
|
||||
keys:
|
||||
- UnityNotificationAndroidRescheduleOnDeviceRestart
|
||||
- UnityNotificationAndroidUseCustomActivity
|
||||
- UnityNotificationAndroidCustomActivityString
|
||||
values:
|
||||
- False
|
||||
- False
|
||||
- com.unity3d.player.UnityPlayerActivity
|
||||
TrackedResourceAssets: []
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45a04f37e0f48c744acc0874c4a8918a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user