Exemple #1
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;
        }
 private Rect GetScreenRect()
 {
     return(GUIUtilityWrap.GUIToScreenRect(m_EditFieldRect));
 }