File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- .meta
1+ * .meta
Original file line number Diff line number Diff line change 1+ using System . Linq ;
2+ using UnityEngine ;
3+ using UnityEditor ;
4+
5+ namespace DllManipulator
6+ {
7+ public class DllManipulatorWindowEditor : EditorWindow
8+ {
9+ [ MenuItem ( "UnityNativeTool/DLL Manipulator" ) ]
10+ static void Init ( )
11+ {
12+ var window = GetWindow < DllManipulatorWindowEditor > ( ) ;
13+ window . Show ( ) ;
14+ }
15+
16+ void OnGUI ( )
17+ {
18+ var dllManipulator = FindObjectOfType < DllManipulator > ( ) ;
19+ if ( dllManipulator == null )
20+ {
21+ dllManipulator = Resources . FindObjectsOfTypeAll < DllManipulator > ( )
22+ . FirstOrDefault ( d => ! EditorUtility . IsPersistent ( d ) && d . gameObject . scene . IsValid ( ) ) ;
23+ }
24+
25+ if ( dllManipulator != null )
26+ {
27+ var editor = Editor . CreateEditor ( dllManipulator ) ;
28+ editor . OnInspectorGUI ( ) ;
29+ }
30+ else
31+ {
32+ EditorGUILayout . Space ( ) ;
33+ EditorGUILayout . LabelField ( $ "There is no { nameof ( DllManipulator ) } script in the scene.") ;
34+ }
35+ }
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments