Skip to content

Commit 5bafe42

Browse files
committed
Made the PathEditor queue another update loop whenever scene or inspector controls are changed. This will let external scripts react to changes in their Update loop if they have the [ExecuteAlways] or [ExecuteInEditMode] attributes added to their script.
1 parent ec55324 commit 5bafe42

1 file changed

Lines changed: 32 additions & 22 deletions

File tree

PathCreator/Core/Editor/PathEditor.cs

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ public override void OnInspectorGUI()
112112

113113
void DrawBezierPathInspector()
114114
{
115-
116115
using (var check = new EditorGUI.ChangeCheckScope())
117116
{
118117
// Path options:
@@ -177,6 +176,7 @@ void DrawBezierPathInspector()
177176
if (check.changed)
178177
{
179178
SceneView.RepaintAll();
179+
EditorApplication.QueuePlayerLoopUpdate ();
180180
}
181181
}
182182
}
@@ -196,7 +196,8 @@ void DrawVertexPathInspector()
196196
{
197197
data.VertexPathSettingsChanged();
198198
SceneView.RepaintAll();
199-
}
199+
EditorApplication.QueuePlayerLoopUpdate ();
200+
}
200201
}
201202
}
202203

@@ -211,6 +212,7 @@ void DrawVertexPathInspector()
211212
if (check.changed)
212213
{
213214
SceneView.RepaintAll();
215+
EditorApplication.QueuePlayerLoopUpdate ();
214216
}
215217
}
216218
DrawGlobalDisplaySettingsInspector();
@@ -231,7 +233,7 @@ void DrawGlobalDisplaySettingsInspector()
231233
{
232234
UpdateGlobalDisplaySettings();
233235
SceneView.RepaintAll();
234-
}
236+
}
235237
}
236238
}
237239

@@ -241,25 +243,33 @@ void DrawGlobalDisplaySettingsInspector()
241243

242244
void OnSceneGUI()
243245
{
244-
handlesStartCol = Handles.color;
245-
switch (data.tabIndex)
246-
{
247-
case bezierPathTab:
248-
ProcessBezierPathInput(Event.current);
249-
DrawBezierPathSceneEditor();
250-
break;
251-
case vertexPathTab:
252-
DrawVertexPathSceneEditor();
253-
break;
254-
}
255-
256-
257-
// Don't allow clicking over empty space to deselect the object
258-
if (Event.current.type == EventType.Layout)
259-
{
260-
HandleUtility.AddDefaultControl(0);
261-
}
262-
}
246+
using (var check = new EditorGUI.ChangeCheckScope ())
247+
{
248+
handlesStartCol = Handles.color;
249+
switch (data.tabIndex)
250+
{
251+
case bezierPathTab:
252+
ProcessBezierPathInput (Event.current);
253+
DrawBezierPathSceneEditor ();
254+
break;
255+
case vertexPathTab:
256+
DrawVertexPathSceneEditor ();
257+
break;
258+
}
259+
260+
261+
// Don't allow clicking over empty space to deselect the object
262+
if (Event.current.type == EventType.Layout)
263+
{
264+
HandleUtility.AddDefaultControl (0);
265+
}
266+
267+
if (check.changed)
268+
{
269+
EditorApplication.QueuePlayerLoopUpdate ();
270+
}
271+
}
272+
}
263273

264274
void DrawVertexPathSceneEditor()
265275
{

0 commit comments

Comments
 (0)