Пример #1
0
        private static void DoFind(MenuCommand data)
        {
            var script = Selection.activeObject as MonoScript;

            if (script == null)
            {
                return;
            }

            var klass = script.GetClass();

            if (typeof(Component).IsAssignableFrom(klass))
            {
                if (_window == null)
                {
                    _window               = EditorWindow.GetWindow <ComponentSearchWindow>();
                    _window._mode         = 0;
                    _window._targetScript = script.GetClass();
                    _window._forceRefresh = true;
                    _window.Show();
                    _window.position = new Rect(20, 80, 500, 300);
                }
                else
                {
                    _window._mode         = 0;
                    _window._targetScript = script.GetClass();
                    _window._forceRefresh = true;
                    _window.Focus();
                }
            }
        }
Пример #2
0
 private void OnDisable()
 {
     if (_window == this)
     {
         _window = null;
     }
 }
        private static void DoFind(MenuCommand data)
        {
            var script = Selection.activeObject as MonoScript;
            if (script == null) return;

            var klass = script.GetClass();
            if (typeof(Component).IsAssignableFrom(klass))
            {
                if (_window == null)
                {
                    _window = EditorWindow.GetWindow<ComponentSearchWindow>();
                    _window._mode = 0;
                    _window._targetScript = script;
                    _window._forceRefresh = true;
                    _window.Show();
                    _window.position = new Rect(20, 80, 500, 300);
                }
                else
                {
                    _window._mode = 0;
                    _window._targetScript = script;
                    _window._forceRefresh = true;
                    _window.Focus();
                }
            }
        }
Пример #4
0
 private void OnEnable()
 {
     if (_window == null)
     {
         _window = this;
     }
     else
     {
         Object.DestroyImmediate(this);
     }
 }
Пример #5
0
 private static void OpenFromMenu()
 {
     if (_window == null)
     {
         _window = EditorWindow.GetWindow <ComponentSearchWindow>();
         _window.Show();
         _window.position = new Rect(20, 80, 500, 300);
     }
     else
     {
         _window.Focus();
     }
 }
 private static void OpenFromMenu()
 {
     if(_window == null)
     {
         _window = EditorWindow.GetWindow<ComponentSearchWindow>();
         _window.Show();
         _window.position = new Rect(20, 80, 500, 300);
     }
     else
     {
         _window.Focus();
     }
 }
 private void OnEnable()
 {
     if (_window == null) _window = this;
     else Object.DestroyImmediate(this);
 }
 private void OnDisable()
 {
     if (_window == this) _window = null;
 }