Exemplo n.º 1
0
        internal GameObject CreateSetting(string nameText, bool nameLocalize, string descriptionText, bool descriptionLocalize, GameObject prefab, string labelName)
        {
            GameObject setting = NGUITools.AddChild(uiGrid.gameObject, prefab);

            setting.name = "Custom Setting (" + nameText + ")";

            Transform labelTransform = setting.transform.Find(labelName);

            SetLabelText(labelTransform, nameText, nameLocalize);

            DescriptionHolder descriptionHolder = setting.AddComponent <DescriptionHolder>();

            descriptionHolder.SetDescription(descriptionText, descriptionLocalize);

            menuItems.Add(setting);
            return(setting);
        }
Exemplo n.º 2
0
        internal void UpdateDescriptionLabel()
        {
            GameObject        setting     = currentTab.menuItems[selectedIndex];
            DescriptionHolder description = setting.GetComponent <DescriptionHolder>();

            if (description is null)
            {
                return;
            }

            UILabel descriptionLabel = InterfaceManager.m_Panel_OptionsMenu.m_OptionDescriptionLabel;

            descriptionLabel.text                    = description.Text;
            descriptionLabel.transform.parent        = setting.transform;
            descriptionLabel.transform.localPosition = new Vector3(655, 0);
            descriptionLabel.gameObject.SetActive(true);
        }