示例#1
0
        private void _RefreshQuestionList(string groupName)
        {
            currentDataDict = consultingDataDict[groupName];
            int flag = currentDataDict.Count - questionInfoList.Count;

            if (flag > 0)
            {
                UIConsultingQuestionInfo info = null;
                GameObject clone = null;
                for (int i = 0; i < flag; i++)
                {
                    clone = UICommonTool.Clone(_questionPrefab.gameObject, _contentTrans);
                    info  = new UIConsultingQuestionInfo();
                    info.Init(clone, _OnClickQuestionCallBack);
                    QuestionAction += info.MovePanel;
                    questionInfoList.Add(info);
                }
            }
            else if (flag < 0)
            {
                for (int i = 0; i < questionInfoList.Count; i++)
                {
                    questionInfoList[i].SetEnable(currentDataDict.Count > i);
                }
            }
            flag = 0;
            foreach (KeyValuePair <string, string> item in currentDataDict)
            {
                questionInfoList[flag].SetEnable(true);
                questionInfoList[flag].SetData(item.Key, item.Value);
                flag++;
            }
        }
示例#2
0
 private void ClosePanel()
 {
     isOpen = false;
     UICommonTool.SetComponentState(ref _lbDescribe, false);
     SetLayOutElementHeight(minHeight);
     UICommonTool.SetComponentHeight(ref _imgBG, minHeight);
     UICommonTool.SetComponentY(ref _imgBG, minY);
 }
示例#3
0
            private void OpenPanel()
            {
                isOpen = true;
                UICommonTool.SetComponentState(ref _lbDescribe, true);
                float height = GetContextHeight();

                SetLayOutElementHeight(height);
                UICommonTool.SetComponentHeight(ref _imgBG, height);
                UICommonTool.SetComponentY(ref _imgBG, heightOffset - height / 2);
            }
示例#4
0
 private void ClosePanel()
 {
     isOpen = false;
     UICommonTool.SetComponentState(ref _lbDescribe, false);
     SetLayOutElementHeight(minHeight);
     UICommonTool.SetComponentHeight(ref _imgBG, minHeight);
     UICommonTool.SetComponentY(ref _imgBG, minY);
     this._lbDescribe.SetActiveEx(false);
     this._lbQuestionName.SetActiveEx(true);
 }
示例#5
0
            public void SetData(string questionName, string describe)
            {
                _questionName = questionName;
                _describe     = describe;

                UICommonTool.SetTextContext(ref _lbQuestionName, questionName);
                UICommonTool.SetTextContext(ref _lbDescribe, describe);
                UICommonTool.SetComponentState(ref _lbDescribe, false);

                ClosePanel();
            }
示例#6
0
            private void OpenPanel()
            {
                isOpen = true;
                UICommonTool.SetComponentState(ref _lbDescribe, true);
                float height = GetContextHeight();

                SetLayOutElementHeight(height);
                UICommonTool.SetComponentHeight(ref _imgBG, height);
                //UICommonTool.SetComponentY(ref _imgBG, heightOffset - height / 2);
                this._lbDescribe.SetActiveEx(true);
                this._lbQuestionName.SetActiveEx(false);
            }
示例#7
0
        private void _OnSelectGroupCallBack(string groupName)
        {
            Audio.AudioManager.Instance.BtnMusic();

            for (var i = 0; i < groupInfo.Length; i++)
            {
                groupInfo [i].SetBtnGray();
            }


            UICommonTool.SetTransformY(ref _contentTrans, TopHigh);
            _RefreshQuestionList(groupName);
        }
示例#8
0
            public void Init(GameObject obj, string name, Action <string> clickCallBack)
            {
                _obj      = obj;
                titleName = name;

                _btnQuestionGroup = obj.GetComponent <Button>();
                EventTriggerListener.Get(_btnQuestionGroup.gameObject).onClick = (go) => {
                    clickCallBack(titleName);
                    SetBtnBright();
                };

                _lbQuestionGroupName = obj.GetComponentEx <Text>(Layout.lb_QuestionGroupName);
                UICommonTool.SetTextContext(ref _lbQuestionGroupName, name);
            }
示例#9
0
            /// <summary>
            /// 设置组件存储的数据
            /// </summary>
            /// <param name="questionName"></param>
            /// <param name="describe"></param>
            public void SetData(FeelingVo value)
            {
                var tmpStri  = value.content;
                var titleStr = "";

                if (tmpStri.Length > 22)
                {
                    titleStr = tmpStri.Substring(0, 2);
                }
                else
                {
                    titleStr = tmpStri;
                }

                UICommonTool.SetTextContext(ref _lbQuestionName, titleStr);
                UICommonTool.SetTextContext(ref _lbDescribe, tmpStri);
                UICommonTool.SetComponentState(ref _lbDescribe, false);
                ClosePanel();
            }
示例#10
0
        private void InitQuestionGroup(GameObject go)
        {
            _questionGroupPrefab = go.GetComponentEx <Transform>(Layout.btn_QuestionGroup);

            groupInfo = new UIConsultingQuestionGroupInfo[consultingDataDict.Count];
            int flag = 0;

            foreach (string item in consultingDataDict.Keys)
            {
                groupInfo[flag] = new UIConsultingQuestionGroupInfo();
                if (flag == 0)
                {
                    groupInfo[flag].Init(_questionGroupPrefab.gameObject, item, _OnSelectGroupCallBack);
                }
                else
                {
                    GameObject clone = UICommonTool.Clone(_questionGroupPrefab.gameObject, go.transform);
                    groupInfo[flag].Init(clone, item, _OnSelectGroupCallBack);
                    groupInfo [flag].SetBtnGray();
                }
                flag++;
            }
        }