We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42fb506 commit c23de1cCopy full SHA for c23de1c
1 file changed
Packages/com.unity.shadergraph/Editor/Data/Graphs/SerializableCubemap.cs
@@ -92,7 +92,12 @@ public Cubemap cubemap
92
93
public void OnBeforeSerialize()
94
{
95
- m_SerializedCubemap = EditorJsonUtility.ToJson(new CubemapHelper { cubemap = cubemap }, false);
+ // If m_Cubemap is null, the data is still in serialized form
96
+ // (m_SerializedCubemap or m_Guid) and doesn't need to be re-serialized.
97
+ // We must not use the cubemap property getter here because it would
98
+ // force-load the asset, which is not safe in all contexts (e.g. domain backup).
99
+ if (m_Cubemap != null)
100
+ m_SerializedCubemap = EditorJsonUtility.ToJson(new CubemapHelper { cubemap = m_Cubemap }, false);
101
}
102
103
public void OnAfterDeserialize()
0 commit comments