Skip to content

Commit 0eed3f6

Browse files
julienamsellemEvergreen
authored andcommitted
[VFX] Prevent from changing any template information in the inspector during the play mode
1 parent fcde269 commit 0eed3f6

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Packages/com.unity.shadergraph/Editor/Importers/ShaderGraphImporterEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ GraphData GetGraphData(AssetImporter importer)
140140
GUIUtility.systemCopyBuffer = generator.generatedShader;
141141
}
142142

143+
EditorGUI.BeginDisabled(EditorApplication.isPlaying);
143144
EditorGUILayout.Space();
144145
EditorGUI.BeginChangeCheck();
145146
EditorGUILayout.PropertyField(serializedObject.FindProperty(ShaderGraphImporter.UseAsTemplateFieldName));
@@ -155,6 +156,7 @@ GraphData GetGraphData(AssetImporter importer)
155156
EditorGUILayout.PropertyField(serializedObject.FindProperty(ShaderGraphImporter.TemplateFieldName));
156157
needsSaveMetaFile |= EditorGUI.EndChangeCheck();
157158
}
159+
EditorGUI.EndDisabled();
158160

159161
if (materialEditor)
160162
{

Packages/com.unity.visualeffectgraph/Editor/Inspector/VFXAssetEditor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ public override VisualElement CreateInspectorGUI()
660660
header.AddToClassList("inspector-header");
661661
header.focusable = false;
662662
root.Add(header);
663+
header.enabledSelf = !EditorApplication.isPlaying;
663664

664665
var allImportersSerializedObject = new SerializedObject(importers.ToArray());
665666
var useAsTemplateProperty = allImportersSerializedObject.FindProperty("m_UseAsTemplate");

0 commit comments

Comments
 (0)