Esempio n. 1
0
        public virtual void ChangeLanguage()
        {
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            if (!lgg.Equals(m_Language))
            {
                m_Language = lgg;
                Text[] ts = gameObject.GetComponentsInChildren <Text>(true);
                foreach (Text t in ts)
                {
                    t.font = Global.gApp.gGameData.GetFont(lgg);
                    if (UiTools.IsNumeric(t.text))
                    {
                        continue;
                    }
                    LanguageTip lt = t.GetComponent <LanguageTip>();
                    if (lt != null)
                    {
                        //Debug.Log(t.text + " use tip = " + lt.TipId);
                        t.text = Global.gApp.gGameData.GetTipsInCurLanguage(lt.TipId);
                    }
                    else
                    {
                        //Debug.Log("text = " + t.text + ", don't add component LanguageTip");
                    }
                }
            }
        }
Esempio n. 2
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);
            string idStr = arg as string;

            if (!UiTools.IsNumeric(idStr))
            {
                Debug.LogErrorFormat("对话id非法 = {0}", idStr);
                TouchClose();
                return;
            }
            campID = int.Parse(idStr);

            var campRes = TableMgr.singleton.CampSetTable.GetItemByID(campID);

            if (campRes == null)
            {
                return;
            }

            TitleText.text.text = LanguageMgr.GetText("CampChapter", campID);
            NameText.text.text  = LanguageMgr.GetText(campRes.tid_name);
        }
Esempio n. 3
0
        public override void Init <T>(string name, UIInfo info, T arg)
        {
            base.Init(name, info, arg);
            string idStr = arg as string;

            if (!UiTools.IsNumeric(idStr))
            {
                Debug.LogErrorFormat("对话id非法 = {0}", idStr);
                TouchClose();
                return;
            }
            groupId      = int.Parse(idStr);
            m_Index      = 0;
            dialogueList = TableMgr.singleton.DialogueTable.GetDialogueByGroup(groupId);
            if (dialogueList == null)
            {
                Debug.LogErrorFormat("对话id非法 = {0}", idStr);
                TouchClose();
                return;
            }

            dialogueRes = dialogueList[m_Index];

            m_tip.gameObject.SetActive(false);
            m_person1.gameObject.SetActive(false);
            m_person2.gameObject.SetActive(false);
            //ShowNode.gameObject.SetActive(false);
            //gameObject.AddComponent<DelayCallBack>().SetAction(()=>
            //{
            //    ShowNode.gameObject.SetActive(true);
            //    UIFresh();
            //    BgBtn.button.onClick.AddListener(UIFresh);
            //}, m_Dialogue.startDelay, true);
            //ShowNode.gameObject.SetActive(true);
            UIFresh();
            BgBtn.button.onClick.AddListener(UIFresh);
        }