Beispiel #1
0
        public static bool Open <T>(SearchWindowContext context, T provider) where T : ScriptableObject, ISearchWindowProvider
        {
            UnityEngine.Object[] array = Resources.FindObjectsOfTypeAll(typeof(SearchWindow));
            bool result;

            if (array.Length > 0)
            {
                try
                {
                    ((EditorWindow)array[0]).Close();
                    result = false;
                    return(result);
                }
                catch (Exception)
                {
                    SearchWindow.s_FilterWindow = null;
                }
            }
            long num = DateTime.Now.Ticks / 10000L;

            if (num >= SearchWindow.s_LastClosedTime + 50L)
            {
                if (SearchWindow.s_FilterWindow == null)
                {
                    SearchWindow.s_FilterWindow           = ScriptableObject.CreateInstance <SearchWindow>();
                    SearchWindow.s_FilterWindow.hideFlags = HideFlags.HideAndDontSave;
                }
                SearchWindow.s_FilterWindow.Init(context, provider);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
 void OnDisable()
 {
     s_LastClosedTime = System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond;
     s_FilterWindow   = null;
 }
 void OnEnable()
 {
     s_FilterWindow = this;
 }
Beispiel #4
0
 private void OnDisable()
 {
     SearchWindow.s_LastClosedTime = DateTime.Now.Ticks / 10000L;
     SearchWindow.s_FilterWindow   = null;
 }
Beispiel #5
0
 private void OnEnable()
 {
     SearchWindow.s_FilterWindow = this;
 }
Beispiel #6
0
 static SearchWindow()
 {
     SearchWindow.s_FilterWindow = null;
     SearchWindow.s_DirtyList    = false;
     SearchWindow.s_DirtyList    = true;
 }