Exemple #1
0
 public bool HasFocus()
 {
     if (m_EditorWindow != null && EditorWindowWrap.HasFocus(m_EditorWindow))
     {
         return(GUIUtility.keyboardControl == m_KeyboardControlID);
     }
     return(false);
 }
        public bool HasFocus()
        {
            if (!ViewConfig.AllowFocusRendering)
            {
                return(true);
            }

            if (m_KeyboardControlID == GUIUtility.keyboardControl)
            {
                return(EditorWindowWrap.HasFocus(Owner.WindowOwner));
            }
            return(false);
        }
Exemple #3
0
        /// <param name="itemPathArray">item的路径数据,路径格式: xxx/yyy/zzz</param>
        /// <param name="itemTexture2DArray">item的图片</param>
        /// <param name="itemInfoArray">item的额外数据,传入点击回调</param>
        /// <param name="clickedAction">点击item的回调</param>
        public void Init(Rect buttonRect, string[] itemPathArray, Texture2D[] itemTexture2DArray, object[] itemInfoArray, Action <string, object> clickedAction)
        {
            s_AddItemWindow.m_ItemPathArray      = itemPathArray;
            s_AddItemWindow.m_ItemTexture2DArray = itemTexture2DArray;
            s_AddItemWindow.m_ItemInfoArray      = itemInfoArray;
            s_AddItemWindow.m_ClickedAction      = clickedAction;

            buttonRect = GUIUtilityWrap.GUIToScreenRect(buttonRect);
            CreateComponentTree();
            EditorWindowWrap.ShowAsDropDown(this, buttonRect, new Vector2(buttonRect.width, kWindowHeight));
            Focus();
            EditorWindowWrap.AddToAuxWindowList(this);
            wantsMouseMove = true;
        }