예제 #1
0
        public override void Start()
        {
            base.Start();

            this.autoLayout          = true;
            this.autoLayoutStart     = LayoutStart.TopLeft;
            this.autoLayoutDirection = LayoutDirection.Vertical;
            this.autoSize            = false;
            this.canFocus            = true;
            this.isInteractive       = true;
            this.width            = WIDTH;
            this.height           = 285;
            this.backgroundSprite = "MenuPanel2";

            Hide();

            title               = AddUIComponent <UILabel>();
            title.width         = 220;
            title.height        = 30;
            title.textScale     = 0.9f;
            title.textAlignment = UIHorizontalAlignment.Center;
            title.text          = "Additional coverage";
            title.padding       = new RectOffset(10, 10, 10, 10);

            fastList           = UIFastList.Create <DistrictRow>(this);
            fastList.size      = new Vector2(this.width, this.height - title.height);
            fastList.rowHeight = 28;
            fastList.canSelect = false;
            fastList.rowsData  = new FastList <object>();
        }
예제 #2
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);
        }