コード例 #1
0
        public void OnLocation1Choose(CUIEvent evt)
        {
            if (evt == null || evt.m_srcWidget == null)
            {
                return;
            }
            CUIListScript component = evt.m_srcWidget.GetComponent <CUIListScript>();

            if (component == null)
            {
                return;
            }
            Transform transform = this.m_searchTypeNodes[6].transform;

            if (transform == null)
            {
                return;
            }
            GameObject    gameObject    = transform.Find("Button_Down").gameObject;
            CUIListScript component2    = transform.Find("List").GetComponent <CUIListScript>();
            int           selectedIndex = component.GetSelectedIndex();

            if (selectedIndex < this.m_addressBook.get_Count())
            {
                Dictionary <string, object> dictionary = this.m_addressBook.get_Item(selectedIndex) as Dictionary <string, object>;
                object obj = null;
                if (dictionary.TryGetValue("sub", ref obj))
                {
                    List <object> list = obj as List <object>;
                    if (list != null)
                    {
                        int num = 0;
                        this.m_searchStrings[6] = new string[list.get_Count()];
                        using (List <object> .Enumerator enumerator = list.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                Dictionary <string, object> dictionary2 = (Dictionary <string, object>)enumerator.get_Current();
                                object obj2 = null;
                                if (dictionary2.TryGetValue("name", ref obj2))
                                {
                                    this.m_searchStrings[6][num] = (obj2 as string);
                                    num++;
                                }
                            }
                        }
                        CUIUtility.RegisterTextComboboxContent(gameObject, component2, this.m_searchStrings[6], null);
                    }
                }
            }
        }
コード例 #2
0
        public void Load(CUIFormScript form)
        {
            if (form == null)
            {
                return;
            }
            GameObject widget  = form.GetWidget(32);
            GameObject widget2 = form.GetWidget(33);

            widget2.CustomSetActive(false);
            if (widget == null)
            {
                for (int i = 0; i < this.m_searchTypeNodes.Length; i++)
                {
                    this.m_searchTypeNodes[i] = null;
                }
                for (int j = 0; j < this.m_searchTypeNodes.Length; j++)
                {
                    this.m_displyTypeNodes[j] = null;
                }
                return;
            }
            this.m_searchTypeNodes[0] = widget.transform.Find("pnlContainer/Social_IWant/DropList");
            this.m_searchTypeNodes[5] = widget.transform.Find("pnlContainer/Social_Position/DropList1");
            this.m_searchTypeNodes[6] = widget.transform.Find("pnlContainer/Social_Position/DropList2");
            this.m_searchTypeNodes[1] = widget.transform.Find("pnlContainer/Social_Time/WeekDropList");
            this.m_searchTypeNodes[2] = widget.transform.Find("pnlContainer/Social_Time/DayDropList");
            this.m_searchTypeNodes[3] = widget.transform.Find("pnlContainer/Social_Speciality/DropList1");
            this.m_searchTypeNodes[4] = widget.transform.Find("pnlContainer/Social_Speciality/DropList2");
            this.m_displyTypeNodes[0] = widget.transform.Find("pnlContainer/Social_IWant/Content");
            this.m_displyTypeNodes[5] = widget.transform.Find("pnlContainer/Social_Position/Content1");
            this.m_displyTypeNodes[6] = widget.transform.Find("pnlContainer/Social_Position/Content2");
            this.m_displyTypeNodes[1] = widget.transform.Find("pnlContainer/Social_Time/WeekContent");
            this.m_displyTypeNodes[2] = widget.transform.Find("pnlContainer/Social_Time/DayContent");
            this.m_displyTypeNodes[3] = widget.transform.Find("pnlContainer/Social_Speciality/Content1");
            this.m_displyTypeNodes[4] = widget.transform.Find("pnlContainer/Social_Speciality/Content2");
            string[] array  = this.m_searchStrings[3];
            string[] array2 = new string[array.Length];
            try
            {
                for (int k = 0; k < array.Length; k++)
                {
                    array2[k] = CHeroInfo.GetHeroJobStr((RES_HERO_JOB)Convert.ToInt32(array[k]));
                }
            }
            catch (Exception var_7_20E)
            {
                Debug.LogError("social 配置表JOB错误,找jason");
            }
            CUIUtility.ClearTextComboboxContent();
            for (int l = 0; l < 6; l++)
            {
                if (!(this.m_searchTypeNodes[l] == null) && this.m_searchStrings[l] != null)
                {
                    CUIListScript component  = this.m_searchTypeNodes[l].Find("List").GetComponent <CUIListScript>();
                    GameObject    gameObject = this.m_searchTypeNodes[l].Find("Button_Down").gameObject;
                    switch (l)
                    {
                    case 3:
                    case 4:
                        CUIUtility.RegisterTextComboboxContent(gameObject, component, array2, null);
                        break;

                    case 5:
                        CUIUtility.RegisterTextComboboxContent(gameObject, component, this.m_searchStrings[l], new CUIUtility.TextComboClickCallback(this.OnLocation1Choose));
                        break;

                    default:
                        CUIUtility.RegisterTextComboboxContent(gameObject, component, this.m_searchStrings[l], null);
                        break;
                    }
                }
            }
            this.m_isInEditmode = false;
            this.UpdateUI();
        }