From c6f48951d32ad0345b0790e41e87ff7e1413816e Mon Sep 17 00:00:00 2001
From: SepComet <202308010230@stu.csust.edu.cn>
Date: Sun, 10 May 2026 16:30:36 +0800
Subject: [PATCH] Fix UGF resource packaging errors
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
资源构建失败是因为资源集合中包含了 AssemblyDefinitionAsset,并且 StreamingAssets 文件夹的创建行为间歇性出现。
此更改移除了资源打包输入中的脚本相关条目,并保留了跟踪的 StreamingAssets 支架文件,使得包输出可以重新生成而不会触发元/文件夹不匹配警告。
限制:Unity/UGF 打包不能在 AssetBundles 中包含 AssemblyDefinitionAsset
限制:StreamingAssets 内容应保持被忽略,而文件夹身份仍被追踪
禁止:保留脚本资源并依赖平台标识 | bundle 包包含 Editor-only 对象
可信:高
范围风险:狭窄
可逆性:干净
指令:不要将 .asmdef/.cs 资产添加到 ResourceCollection 中;只有 runtime 资产才能进入 bundle
测试:资源构建器打包运行完成,且没有之前的两个错误
---
.gitignore | 8 ++-
.vscode/extensions.json | 5 --
.vscode/launch.json | 10 ---
.vscode/settings.json | 61 -------------------
Assets/GameMain/Configs/ResourceBuilder.xml | 10 +--
.../GameMain/Configs/ResourceCollection.xml | 3 -
Assets/Launcher.unity | 4 +-
Assets/StreamingAssets.meta | 8 +++
Assets/StreamingAssets/.gitkeep | 0
ProjectSettings/ProjectSettings.asset | 8 ++-
10 files changed, 25 insertions(+), 92 deletions(-)
delete mode 100644 .vscode/extensions.json
delete mode 100644 .vscode/launch.json
delete mode 100644 .vscode/settings.json
create mode 100644 Assets/StreamingAssets.meta
create mode 100644 Assets/StreamingAssets/.gitkeep
diff --git a/.gitignore b/.gitignore
index 2592865..c527c3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -75,8 +75,10 @@ crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
-/Assets/StreamingAssets
-/Assets/StreamingAssets.meta
+/Assets/StreamingAssets/**
+!/Assets/StreamingAssets/.gitkeep
+!/Assets/StreamingAssets.meta
+
/UI参考
/bin
/docs/screenshot
@@ -87,3 +89,5 @@ crashlytics-build.properties
~$*.xlsx
Assets/GameMain/Configs/ResourceBuilder.xml
/.dotnet
+/.omx
+/.vscode
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
deleted file mode 100644
index ddb6ff8..0000000
--- a/.vscode/extensions.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "recommendations": [
- "visualstudiotoolsforunity.vstuc"
- ]
-}
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index da60e25..0000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Attach to Unity",
- "type": "vstuc",
- "request": "attach"
- }
- ]
-}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index cfbb280..0000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "files.exclude": {
- "**/.DS_Store": true,
- "**/.git": true,
- "**/.vs": true,
- "**/.gitmodules": true,
- "**/.vsconfig": true,
- "**/*.booproj": true,
- "**/*.pidb": true,
- "**/*.suo": true,
- "**/*.user": true,
- "**/*.userprefs": true,
- "**/*.unityproj": true,
- "**/*.dll": true,
- "**/*.exe": true,
- "**/*.pdf": true,
- "**/*.mid": true,
- "**/*.midi": true,
- "**/*.wav": true,
- "**/*.gif": true,
- "**/*.ico": true,
- "**/*.jpg": true,
- "**/*.jpeg": true,
- "**/*.png": true,
- "**/*.psd": true,
- "**/*.tga": true,
- "**/*.tif": true,
- "**/*.tiff": true,
- "**/*.3ds": true,
- "**/*.3DS": true,
- "**/*.fbx": true,
- "**/*.FBX": true,
- "**/*.lxo": true,
- "**/*.LXO": true,
- "**/*.ma": true,
- "**/*.MA": true,
- "**/*.obj": true,
- "**/*.OBJ": true,
- "**/*.asset": true,
- "**/*.cubemap": true,
- "**/*.flare": true,
- "**/*.mat": true,
- "**/*.meta": true,
- "**/*.prefab": true,
- "**/*.unity": true,
- "build/": true,
- "Build/": true,
- "Library/": true,
- "library/": true,
- "obj/": true,
- "Obj/": true,
- "Logs/": true,
- "logs/": true,
- "ProjectSettings/": true,
- "UserSettings/": true,
- "temp/": true,
- "Temp/": true
- },
- "dotnet.defaultSolution": "VampireLike.sln",
- "dotnet.preferCSharpExtension": true
-}
\ No newline at end of file
diff --git a/Assets/GameMain/Configs/ResourceBuilder.xml b/Assets/GameMain/Configs/ResourceBuilder.xml
index 0298581..fb32177 100644
--- a/Assets/GameMain/Configs/ResourceBuilder.xml
+++ b/Assets/GameMain/Configs/ResourceBuilder.xml
@@ -3,16 +3,16 @@
1
- 33
+ 1
1
UnityGameFramework.Runtime.DefaultCompressionHelper
False
- False
+ True
VampireLike.Editor.VampireLikeBuildEventHandler
- C:/UnityProjects/VampireLike/bin/AssetBundles
+ D:/Learn/GameLearn/UnityProjects/VampireLike/bin/AssetBundles
True
- False
- False
+ True
+ True
\ No newline at end of file
diff --git a/Assets/GameMain/Configs/ResourceCollection.xml b/Assets/GameMain/Configs/ResourceCollection.xml
index fc24acd..f948d45 100644
--- a/Assets/GameMain/Configs/ResourceCollection.xml
+++ b/Assets/GameMain/Configs/ResourceCollection.xml
@@ -17,7 +17,6 @@
-
@@ -85,7 +84,6 @@
-
@@ -97,7 +95,6 @@
-
diff --git a/Assets/Launcher.unity b/Assets/Launcher.unity
index d435872..eb850e8 100644
--- a/Assets/Launcher.unity
+++ b/Assets/Launcher.unity
@@ -731,7 +731,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 11499388, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_EditorResourceMode
- value: 1
+ value: 0
objectReference: {fileID: 0}
- target: {fileID: 11499388, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
propertyPath: m_JsonHelperTypeName
@@ -853,7 +853,6 @@ MonoBehaviour:
_showCollisionStats: 0
_showSpawnControls: 1
_showBattleDurationControls: 1
- _showSeparationSolverControls: 0
_showPlayerWeaponControls: 1
_showPlayerHealthControls: 1
_showTips: 0
@@ -1450,7 +1449,6 @@ MonoBehaviour:
_projectileHitMarkerColor: {r: 1, g: 0, b: 0, a: 0.95}
_projectileHitEffectEnabled: 0
_projectileHitEffectTypeId: 0
- _useSimulationMovement: 1
_collisionPipelineSettings:
ProjectileCollisionQueryRadius: 0.35
ProjectileMaxCandidatesPerQuery: 1
diff --git a/Assets/StreamingAssets.meta b/Assets/StreamingAssets.meta
new file mode 100644
index 0000000..35a2c37
--- /dev/null
+++ b/Assets/StreamingAssets.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 791237245bf8032449e4a887b278248f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/StreamingAssets/.gitkeep b/Assets/StreamingAssets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset
index ceef918..f2761e7 100644
--- a/ProjectSettings/ProjectSettings.asset
+++ b/ProjectSettings/ProjectSettings.asset
@@ -8,7 +8,7 @@ PlayerSettings:
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
AndroidEnableSustainedPerformanceMode: 0
- defaultScreenOrientation: 4
+ defaultScreenOrientation: 2
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
@@ -831,7 +831,8 @@ PlayerSettings:
tvOS: DOTWEEN
additionalCompilerArguments: {}
platformArchitecture: {}
- scriptingBackend: {}
+ scriptingBackend:
+ Standalone: 1
il2cppCompilerConfiguration: {}
il2cppCodeGeneration: {}
managedStrippingLevel:
@@ -843,6 +844,7 @@ PlayerSettings:
PS5: 1
QNX: 1
Stadia: 1
+ Standalone: 1
VisionOS: 1
WebGL: 1
Windows Store Apps: 1
@@ -934,7 +936,7 @@ PlayerSettings:
embeddedLinuxEnableGamepadInput: 1
hmiLogStartupTiming: 0
hmiCpuConfiguration:
- apiCompatibilityLevel: 6
+ apiCompatibilityLevel: 3
activeInputHandler: 1
windowsGamepadBackendHint: 0
cloudProjectId: