public void Init(NpcQuestItemDTO questItem, Transform followNode, Action action)
        {
            m_FollowNode.SetFloowNode(followNode);
            gameObject.AddComponent <DelayCallBack>().SetAction(action, 2, true);
            int         state   = questItem.state;
            CampNpcItem npcItem = Global.gApp.gGameData.CampNpcConfig.Get(questItem.npcId);

            if (state == NpcState.None)
            {
                int plotLength = npcItem.NoTask.Length;
                int plotIndex  = UnityEngine.Random.Range(0, plotLength);
                TaskText.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(npcItem.NoTask[plotIndex]);
            }
            else if (state == NpcState.Received)
            {
                int plotLength = npcItem.TaskFinished.Length;
                int plotIndex  = UnityEngine.Random.Range(0, plotLength);
                TaskText.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(npcItem.NoTask[plotIndex]);
            }
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            TaskText.text.font = Global.gApp.gGameData.GetFont(lgg);
        }
Beispiel #2
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");
                    }
                }
            }
        }
Beispiel #3
0
 protected void AdapterName(string itemName)
 {
     if (m_NameMesh == null)
     {
         m_NameMesh = transform.Find(GameConstVal.TextMeshName);
     }
     if (m_NameMesh != null)
     {
         ItemItem itemCfg = Global.gApp.gGameData.GetItemDataByName(itemName);
         if (itemCfg != null)
         {
             TextMesh textMesh = m_NameMesh.GetComponent <TextMesh>();
             string   lgg      = Global.gApp.gSystemMgr.GetMiscMgr().Language;
             if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
             {
                 lgg = UiTools.GetLanguage();
             }
             textMesh.text = Global.gApp.gGameData.GetTipsInCurLanguage(itemCfg.sourceLanguage);
             textMesh.font = Global.gApp.gGameData.GetFont(lgg);
             MeshRenderer meshRenderer = m_NameMesh.GetComponent <MeshRenderer>();
             if (meshRenderer != null)
             {
                 meshRenderer.sharedMaterial = textMesh.font.material;
             }
         }
     }
 }
Beispiel #4
0
        public void ShowText(string text)
        {
            Plottxt.text.text = text;
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            Plottxt.text.font = Global.gApp.gGameData.GetFont(lgg);
        }
        public void SetPlotId(int plotId)
        {
            TaskText.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(plotId);
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            TaskText.text.font = Global.gApp.gGameData.GetFont(lgg);
        }
        private void ShowTextImp(string text)
        {
            TipsText.text.text = text;
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            TipsText.text.font = Global.gApp.gGameData.GetFont(lgg);
            Destroy(gameObject, 1);
        }