コード例 #1
0
        public override void OnInspectorGUI()
        {
            OnHeaderGUI();

            if (ComponentUtility.MoveComponentDown(target))
            {
                return;
            }

            if (!InternalEditorUtility.GetIsInspectorExpanded(target))
            {
                InternalEditorUtility.SetIsInspectorExpanded(target, true);
                ActiveEditorTracker.sharedTracker.ForceRebuild();
                return;
            }

            try { EditorGUILayout.GetControlRect(GUILayout.Height(30)); } catch { return; }
            var content = EditorGUIUtility.TrTextContent("Add HotScript");
            var rect    = topRect;

            rect.x     += (rect.width - 230) / 2 - 8;
            rect.width  = 230;
            rect.height = 23;
            rect.y     += 8;
            if (EditorGUI.DropdownButton(rect, content, FocusType.Passive, "AC Button"))
            {
                Helper.assemblyLoader?.Reloead();
                AddScriptWindow.Show(rect, OnAddScript, OnFilterScript);
            }
        }
コード例 #2
0
ファイル: AddScriptWindow.cs プロジェクト: psygames/HotUnity
        public static void Show(Rect rect, Action <string> onAddScript, Func <string, string[]> onFilerScripts)
        {
            if (_instance == null)
            {
                _instance = CreateInstance <AddScriptWindow>();
            }

            _instance.Init(rect, onAddScript, onFilerScripts);
            _instance.Repaint();
        }