File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Packages/com.unity.shadergraph/Editor/Data/Graphs Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,12 @@ public Cubemap cubemap
9292
9393 public void OnBeforeSerialize ( )
9494 {
95- m_SerializedCubemap = EditorJsonUtility . ToJson ( new CubemapHelper { cubemap = cubemap } , false ) ;
95+ // 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 ) ;
96101 }
97102
98103 public void OnAfterDeserialize ( )
You can’t perform that action at this time.
0 commit comments