コード例 #1
0
 public static void OpenUI()
 {
     if (wnd == null)
     {
         wnd = GetWindow <XComponentBindingEditWindows>();
     }
     else
     {
         wnd.Show();
         wnd.Focus();
     }
     wnd.titleContent = new GUIContent("Binding - " + target.name);
 }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
 private void OnDestroy()
 {
     wnd = null;
 }