Esempio n. 1
0
        /// <summary>
        /// 显示窗口
        /// </summary>
        /// <param name="rect"></param>
        /// <param name="searchStringKey">保存搜索值的键</param>
        public static bool Show(Rect rect, string searchStringKey)
        {
            Object[] objectsOfTypeAll = Resources.FindObjectsOfTypeAll(typeof(AddItemWindow));
            if (objectsOfTypeAll.Length > 0)
            {
                ((EditorWindow)objectsOfTypeAll[0]).Close();
                return(false);
            }

            if (DateTime.Now.Ticks / 10000L < s_LastClosedTime + 50L)
            {
                return(false);
            }

            if (Event.current != null)
            {
                Event.current.Use();
            }

            s_ItemSearchKey = searchStringKey;

            if (s_AddItemWindow == null)
            {
                s_AddItemWindow = CreateInstance <AddItemWindow>();
            }

            return(true);
        }
Esempio n. 2
0
 private void OnDisable()
 {
     s_LastClosedTime = DateTime.Now.Ticks / 10000L;
     s_AddItemWindow  = null;
 }