-
Notifications
You must be signed in to change notification settings - Fork 19
Editor GUI Fixes #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor GUI Fixes #15
Changes from 5 commits
9263c10
88a8895
34a6b01
74c1c96
87dcb2a
3d11bc8
b478c7b
1a33f4d
39c4fce
5f7b79c
5bda990
66c60cf
a0dc185
e5edbf4
05fc35c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,11 +59,14 @@ public class DllManipulatorEditor : Editor | |
| private bool _showTargetAssemblies = true; | ||
| private string[] _allKnownAssemblies = null; | ||
| private DateTime _lastKnownAssembliesRefreshTime; | ||
|
|
||
|
|
||
| public static event Action RepaintAllEditors = delegate {}; | ||
|
|
||
| public DllManipulatorEditor() | ||
| { | ||
| EditorApplication.pauseStateChanged += _ => Repaint(); | ||
| EditorApplication.playModeStateChanged += _ => Repaint(); | ||
| RepaintAllEditors += Repaint; | ||
| } | ||
|
|
||
| public override void OnInspectorGUI() | ||
|
|
@@ -139,6 +142,11 @@ public override void OnInspectorGUI() | |
| var time = t.InitializationTime.Value; | ||
| EditorGUILayout.LabelField($"Initialized in: {(int)time.TotalSeconds}.{time.Milliseconds.ToString("D3")}s"); | ||
| } | ||
|
|
||
| if (GUI.changed) | ||
| { | ||
| EditorUtility.SetDirty(target); | ||
| } | ||
| } | ||
|
|
||
| private void DrawUsedDlls(IList<NativeDllInfo> usedDlls) | ||
|
|
@@ -333,5 +341,12 @@ public static void UnloadAll() | |
| { | ||
| DllManipulator.UnloadAll(); | ||
| } | ||
|
|
||
| [NativeDllLoadedTrigger] | ||
| [NativeDllAfterUnloadTrigger] | ||
| public static void RepaintAll() | ||
| { | ||
| RepaintAllEditors.Invoke(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's usually safer to handle null case with events (which can be done simply by putting ? before the dot). In this case you initialize the event, however I'm not sure if adding and removing an listener doesn't reset it back to null. Either or, it's better to be safe.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed however as the event is initialized with the default delegate it will never be null. https://stackoverflow.com/q/170907/9295437 |
||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.