public static AdapterInspectorWindows ShowWindows(Object target, SerializedObject so, Action closeCall) { AdapterInspectorWindows windows = EditorWindow.GetWindow <AdapterInspectorWindows>(false, "编辑窗口", true); windows.Show(); windows.Target = target; windows.serializedObject = so; windows.closeCall = closeCall; windows.winState = 1; EditorWindow.FocusWindowIfItsOpen <AdapterInspectorWindows>(); return(windows); }
public override void OnInspectorGUI() { //try //{ if (GUILayout.Button("窗口") || (windows != null && windows.winState == 2)) { windows = AdapterInspectorWindows.ShowWindows(target, serializedObject, CloseWindows); } AdapterInspector.SetTarget(target, serializedObject); //} //catch (Exception e) //{ // Debug.LogWarning(e.ToString()); //} }
void CloseWindows() { windows = null; }