예제 #1
0
        /// <summary>
        /// 显示界面
        /// </summary>
        public void ShowUI()
        {
            TableScroll.SetItemDatas(mSelectBoxList.ToArray());
            mCurCell = FirstCell;
            mCurCell.SetSelectSpStatus(true);
            RefreshBtnStatus();

            Hotfix_LT.Data.SelectBox firstData = mSelectBoxList[0];
            mCurSelectItemId = firstData.ri1;
            if (firstData.rt1.Equals("hero"))
            {
                TitleLab.text = EB.Localizer.GetString("ID_SELECTBOX_SELECT_PARTNER");
                string str = GetPartnerTypeName(firstData.ri1);
                Desc1.text = string.Format(EB.Localizer.GetString("ID_SELECTBOX_DESC_PARTNER"), str);
            }
            else if (firstData.rt1.Equals("heroshard"))
            {
                TitleLab.text = EB.Localizer.GetString("ID_SELECTBOX_SELECT_PARTNER_CLIP");
                string str = GetPartnerTypeName(firstData.ri1);
                Desc1.text = string.Format(EB.Localizer.GetString("ID_SELECTBOX_DESC_PARTNER_CLIP"), str);
            }
            else if (firstData.rt1.Equals("gaminventory"))
            {
                TitleLab.text = EB.Localizer.GetString("ID_SELECTBOX_SELECT_EQUIPMENT");
                Desc1.text    = EB.Localizer.GetString("ID_SELECTBOX_DESC_EQUIPMENT");
            }
        }
예제 #2
0
        /// <summary>
        /// 点击item
        /// </summary>
        /// <param name="cell"></param>
        public void OnClickSelectBoxItem(LTSelectBoxCellController cell)
        {
            if (cell == null)
            {
                EB.Debug.LogError("LTSelectBoxController OnClickSelectBoxItem is Error, cell is Null");
                return;
            }

            if (cell.GetCurSelectBoxData() == null)
            {
                return;
            }

            if (mCurCell != null)
            {
                mCurCell.SetSelectSpStatus(false);
            }

            mCurCell = cell;
            mCurCell.SetSelectSpStatus(true);
            mCurSelectItemId = cell.GetCurSelectBoxData().ri1;
        }
예제 #3
0
        public override void Awake()
        {
            base.Awake();

            var t = controller.transform;

            TitleLab              = t.GetComponent <UILabel>("BG/Title");
            Desc1                 = t.GetComponent <UILabel>("Desc/Desc1");
            CountLab              = t.GetComponent <UILabel>("Use/UseNum");
            LeftArrowMask         = t.FindEx("Use/LeftArrow/LeftArrowMask").gameObject;
            RightArrowMask        = t.FindEx("Use/RightArrow/RightArrowMask").gameObject;
            LeftArrowBtn          = t.GetComponent <UIButton>("Use/LeftArrow");
            RightArrowBtn         = t.GetComponent <UIButton>("Use/RightArrow");
            FirstCell             = t.GetMonoILRComponent <LTSelectBoxCellController>("ItemList/Scroll View/Placeholder/Grid/Row/Item");
            TableScroll           = t.GetMonoILRComponent <LTSelectBoxTableScroll>("ItemList/Scroll View/Placeholder/Grid");
            controller.backButton = t.GetComponent <UIButton>("CloseBtn");

            t.GetComponent <UIButton>("ConfirmBtn").onClick.Add(new EventDelegate(OnClickConfirmBtn));
            t.GetComponent <UIButton>("Use/Max").onClick.Add(new EventDelegate(OnClickMaxBtn));

            t.GetComponent <ContinuePressTrigger>("Use/LeftArrow").m_CallBackPress.Add(new EventDelegate(OnPressLeftArrowBtn));
            t.GetComponent <ContinuePressTrigger>("Use/RightArrow").m_CallBackPress.Add(new EventDelegate(OnPressRightArrowBtn));
        }