public static void OpenUI() { if (wnd == null) { wnd = GetWindow <XComponentBindingEditWindows>(); } else { wnd.Show(); wnd.Focus(); } wnd.titleContent = new GUIContent("Binding - " + target.name); }
public override void OnInspectorGUI() { if (!refresh_data) { refreshData(); } //base.OnInspectorGUI(); //Debug的时候用的 EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField(target.name, EditorStyles.centeredGreyMiniLabel); mToolbar_Index = GUILayout.Toolbar(mToolbar_Index, mToolbar_Text); GUILayout.Space(4); if (mToolbar_Index == 0) { DrawUnityObjectBindingGUI(); } else if (mToolbar_Index == 1) { DrawTypeObjectBindingGUI(); } GUILayout.Space(5); if (GUILayout.Button(I18Ns.OpenEditWindow)) { XComponentBindingEditWindows.target = _target; XComponentBindingEditWindows.OpenUI(); } EditorGUILayout.EndVertical(); if (this.serializedObject.hasModifiedProperties) { mChanged = true; } else { mChanged = false; } this.serializedObject.ApplyModifiedProperties(); if (mChanged) { mChanged = false; OnChanged(); } }
private void OnDestroy() { wnd = null; }