`urp-postprocessing`: Global Volume template's `profile.Add<T>()` overrides are lost after Editor restart (never added as sub-assets)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 72/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
研究方向
Read skills/urp-postprocessing/references/code-templates.md at “Creating a Global Volume with Effects” and the cited sections of skills/urp-postprocessing/SKILL.md. Check how the template adds components and how the skill describes persistence and diagnostics. Update the guidance and template to account for Editor asset persistence; done when newly added overrides survive an asset reload and the documented checks identify missing sub-assets.
由索引模型根據 Issue 內容生成。
描述
Plugin: 0.1.8-beta (main @ 3831ddb) · Unity: 6000.6.7f1 · URP / SRP Core: 17.6.0
Problem
skills/urp-postprocessing/references/code-templates.md, "Creating a Global Volume with Effects" (L19–43):
AssetDatabase.CreateAsset(profile, …)profile.Add<Bloom>()/profile.Add<Tonemapping>()SetDirty(profile)+AssetDatabase.SaveAssets()
The added VolumeComponents are never stored as sub-assets of the profile. Everything looks right for the rest of the session, but after an Editor restart (or any reload of the asset) the profile has no overrides. We hit exactly this: a color-grading profile built this way came back empty after restarting the Editor.
SKILL.md L111, L141, L148, L156 present profile.Add<T>() as the way to add overrides, with no Editor-persistence caveat.
Why
VolumeProfile.Add(Type, bool)(com.unity.render-pipelines.core/Runtime/Volume/VolumeProfile.csL109–123) only doesCreateInstance(type)+components.Add(component)— noAssetDatabase.AddObjectToAsset, so the component lives in memory only and the reference does not survive serialization. On the next loadVolumeProfile.OnEnablerunscomponents.RemoveAll(x => x == null).- Unity's own Editor code always pairs
AddwithAddObjectToAsset:Editor/Volume/VolumeComponentListEditor.cs(inspector "Add Override", L518:AssetDatabase.AddObjectToAsset(component, asset)),Editor/Volume/VolumeProfileFactory.cs(VolumeProfileFactory.CreateVolumeComponent<T>, L109),Editor/Volume/VolumeProfileUtils.cs.
The skill's own checks don't catch it
SKILL.mdL87–91 only warns whenprofile.components.Count == 0; in the same session the list still holds the in-memory instances, so it reports the setup as correct.code-templates.mdL123–125 saysSaveAssets()persists the profile — true for editing existing overrides, not for newly added ones.
Suggested fix
- In the template, after each
Add<T>():UnityEditor.AssetDatabase.AddObjectToAsset(bloom, profile);— or useUnityEditor.Rendering.VolumeProfileFactory.CreateVolumeComponent<T>(profile, overrides: true, saveAsset: false), thenSaveAssets()once. - Key Facts: "On a profile asset in the Editor,
Add<T>()alone is in-memory only; also callAssetDatabase.AddObjectToAsset. A runtimevolume.profileinstance doesn't need it." - Diagnostic: also warn when
EditorUtility.IsPersistent(profile)and any component has!AssetDatabase.IsSubAsset(c).
- 主要語言
- C#
- 星號
- 617
- 分支
- 67
- 平均合併
- 1 天 3 小時
- 30 天內合併 PR
- 13
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Unity-Technologies/unity-agent-plugin 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 80/100
Unity-Technologies/unity-agent-plugin#118 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
Unity-Technologies/unity-agent-plugin#105 · 1 則留言 ·
維護者通常 1 天內回覆
-
`ui-uitk`: USS Restrictions table bans `filter` and `transition-property`, both supported in Unity 6未關閉
難度 1/5 1 小時以內 新手友好度 85/100
Unity-Technologies/unity-agent-plugin#102 · 1 則留言 ·
維護者通常 1 天內回覆
查看 Unity-Technologies/unity-agent-plugin 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
ardalis/CleanArchitecture#1150 ·
維護者通常 1 天內回覆
-
area:data coverage
難度 1/5 1 小時以內 新手友好度 68/100
reacher-z/Awesome-CUA#5039 ·
維護者通常 19 天內回覆
-
Bug
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
Facepunch/sbox-public#12305 ·
維護者通常 5 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
JiaFeiMiao-K-Cat/DiscImageStudio#205 ·
維護者通常 1 天內回覆