Example #1
0
        /// <summary>
        /// Use this to create the UIFastList.
        /// Do NOT use AddUIComponent.
        /// I had to do that way because MonoBehaviors classes cannot be generic
        /// </summary>
        /// <typeparam name="T">The type of the row UI component</typeparam>
        /// <param name="parent"></param>
        /// <returns></returns>
        public static UIFastList Create <T>(UIComponent parent)
            where T : UIPanel, IUIFastListRow
        {
            UIFastList list = parent.AddUIComponent <UIFastList>();

            list.m_rowType = typeof(T);
            return(list);
        }
Example #2
0
        private void CreatePanelComponents()
        {
            usedRoutesList = UIFastList.Create <UsedRouteRowItem>(this);
            usedRoutesList.backgroundSprite = "UnlockingPanel";
            usedRoutesList.size             = new Vector2(this.width - m_UIPadding.left - m_UIPadding.right, (this.height - titleOffset - m_UIPadding.top - m_UIPadding.bottom));
            usedRoutesList.canSelect        = false;
            usedRoutesList.relativePosition = new Vector2(m_UIPadding.left, titleOffset + m_UIPadding.top);
            usedRoutesList.rowHeight        = 40f;
            usedRoutesList.rowsData.Clear();
            usedRoutesList.selectedIndex = -1;

            RefreshList();
        }