Beispiel #1
0
        private void UpdateTags()
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath);

            if (form == null)
            {
                return;
            }
            GameObject widget = form.GetWidget(32);

            if (widget == null)
            {
                return;
            }
            Transform transform = widget.transform.Find("pnlContainer/Social_Tag");

            if (transform != null)
            {
                if (!this.m_isInEditmode)
                {
                    CPlayerProfile profile = Singleton <CPlayerInfoSystem> .instance.GetProfile();

                    this.m_tags.Clear();
                    for (int i = 0; i < (int)profile._socialCardInfo.bTagNum; i++)
                    {
                        this.m_tags.Add(profile._socialCardInfo.TagList[i]);
                    }
                }
                transform.FindChild("btnEdit").gameObject.CustomSetActive(this.m_isInEditmode);
                for (int j = 0; j < this.m_tags.get_Count(); j++)
                {
                    GameObject gameObject = transform.FindChild("TagGroup/Tag" + (j + 1)).gameObject;
                    gameObject.CustomSetActive(true);
                    Text          component   = gameObject.transform.Find("Text").GetComponent <Text>();
                    int           id          = Convert.ToInt32(this.m_tags.get_Item(j));
                    ResSocialTags dataByIndex = GameDataMgr.socialTagsDataBin.GetDataByIndex(id);
                    component.set_text(dataByIndex.szText);
                    byte bType = dataByIndex.bType;
                    if (bType != 1)
                    {
                        if (bType == 2)
                        {
                            component.set_color(this.m_colorTagKawaii);
                        }
                    }
                    else
                    {
                        component.set_color(this.m_colorTagCool);
                    }
                }
                for (int k = this.m_tags.get_Count(); k < 4; k++)
                {
                    GameObject gameObject2 = transform.FindChild("TagGroup/Tag" + (k + 1)).gameObject;
                    gameObject2.CustomSetActive(false);
                }
            }
        }
Beispiel #2
0
        public void OnEditTag(CUIEvent evt)
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CPlayerSocialInfoController.s_socialTagEditFormPath, false, true);

            if (!cUIFormScript)
            {
                return;
            }
            GameObject widget = cUIFormScript.GetWidget(0);

            if (widget != null)
            {
                CUIToggleListScript component = widget.transform.GetComponent <CUIToggleListScript>();
                int num = GameDataMgr.socialTagsDataBin.Count();
                component.SetElementAmount(num);
                for (int i = 0; i < num; i++)
                {
                    CUIToggleListElementScript cUIToggleListElementScript = (CUIToggleListElementScript)component.GetElemenet(i);
                    ResSocialTags dataByIndex = GameDataMgr.socialTagsDataBin.GetDataByIndex(i);
                    if (cUIToggleListElementScript != null)
                    {
                        Transform transform  = cUIToggleListElementScript.gameObject.transform;
                        Transform transform2 = transform.Find("Text");
                        CUICommonSystem.SetTextContent(transform2.gameObject, dataByIndex.szText);
                        Text component2 = transform2.transform.GetComponent <Text>();
                        byte bType      = dataByIndex.bType;
                        if (bType != 1)
                        {
                            if (bType == 2)
                            {
                                component2.set_color(this.m_colorTagKawaii);
                            }
                        }
                        else
                        {
                            component2.set_color(this.m_colorTagCool);
                        }
                    }
                }
                component.SetSelectLimitCount(4);
                for (int j = 0; j < this.m_tags.get_Count(); j++)
                {
                    component.SetMultiSelected(Convert.ToInt32(this.m_tags.get_Item(j)), true);
                }
            }
            this.OnTagSelectChanged(null);
        }