Esempio n. 1
0
    public string Show(string id)
    {
        string strResult = string.Empty;

        strResult = LanguageMgr.GetInstance().ShowText(id);
        return(strResult);
    }
Esempio n. 2
0
    public void ClickOpenSetting()
    {
        setting.SetActive(true);
        switch (GameConfig.Language)
        {
        case LangType.zh_Hans:
            LanguageMgr.GetInstance().SwitchLanguage(LangType.zh_Hans);
            cnY.SetActive(false);
            cnG.SetActive(true);
            enY.SetActive(true);
            enG.SetActive(false);
            break;

        case LangType.zh_Hant:
            LanguageMgr.GetInstance().SwitchLanguage(LangType.zh_Hant);
            break;

        case LangType.en:
            LanguageMgr.GetInstance().SwitchLanguage(LangType.en);
            cnY.SetActive(true);
            cnG.SetActive(false);
            enY.SetActive(false);
            enG.SetActive(true);
            break;
        }
    }
Esempio n. 3
0
 private void Start()
 {
     MessageText.text = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.TieHand);
     cmdTimer         = CommandTimer.CreateTimer("PromptTyingHandTimer");
     cmdTimer.StartTimer(CountDownNum, FinishTimer, ShowLeftTime);
     //SendMessage(HiddenObjectMessage.MsgStopGame, "", "True");
     //CloseUIForm(HiddenObjectPage.ResettingPage, true);
 }
 private void Start()
 {
     LostTimeTitle.text   = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.LostTime);
     lostTimeNum.text     = GameStart.Instance.CurrentGameRecorder.LostTime.ToString();
     TotalScoreTitle.text = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.FinalScore);
     TotalScoreNum.text   = GameStart.Instance.CurrentGameRecorder.Score.ToString();
     ExitMessage.text     = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.ExitMessage);
 }
Esempio n. 5
0
 public void ClickEn()
 {
     LanguageMgr.GetInstance().SwitchLanguage(LangType.en);
     cnY.SetActive(true);
     cnG.SetActive(false);
     enY.SetActive(false);
     enG.SetActive(true);
 }
Esempio n. 6
0
    /// <summary>
    /// 加载主题
    /// </summary>
    private void LoadMenu(GameObject menu, string n)
    {
        //加载主题名字
        Text name = menu.GetComponentInChildren <Text>();
        //name.text = LevelMgr.GetInstance().GetThemeConfig(n).ThemeName;
        uint id = LevelMgr.GetInstance().GetThemeConfig(n).ThemeName;

        //Debug.Log(name.text + id);
        LanguageMgr.GetInstance().GetLangStrByID(name, id);
    }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     if (!string.IsNullOrEmpty(key))
     {
         string value = LanguageMgr.GetInstance().GetText(key);
         if (!string.IsNullOrEmpty(value))
         {
             GetComponent <Text>().text = value;
         }
     }
 }
Esempio n. 8
0
 /// <summary>
 /// 判空操作
 /// </summary>
 /// <param name="text"></param>text组件
 /// <param name="key"></param>对应的键值
 public void IsNull(Text text, int key)
 {
     if (null != text)
     {
         string value = LanguageMgr.GetInstance().GetText(key);
         if (!string.IsNullOrEmpty(value))
         {
             text.text = value;
         }
     }
 }
Esempio n. 9
0
    //private void OnEnable()
    //{
    //}

    IEnumerator TipsMove()
    {
        uint          configid = (uint)argv[0];
        List <object> objs     = new List <object>(argv);

        objs.RemoveAt(0);
        LanguageMgr.GetInstance().GetLangStrByID(m_Txt, configid, false, objs.ToArray());
        m_Txt.gameObject.SetActive(true);
        yield return(new WaitForSeconds(m_FloatTime));

        m_Txt.gameObject.SetActive(false);
        co = null;
        Close();
    }
Esempio n. 10
0
    public void Init()
    {
        Debuger.Init();
        Debuger.EnableLog = GameConfig.IsDebug;
        LanguageMgr.GetInstance().SetUp();
        int count = XPlayerPrefs.GetInt(StartUpCount_Tag) + 1;

        XPlayerPrefs.SetInt(StartUpCount_Tag, count);
        Application.targetFrameRate = 60;
        //UIMgr.ShowPage(UIPageEnum.Main_Page);
        processList = new List <PreProcess>()
        {
            new BinProcess(),
            new AtlasProcess(),
            new AbProcess()
        };
        StartCoroutine(Preprocess());
    }
Esempio n. 11
0
    private void ModiMapAndInfo()
    {
        updateFlag = false;
        //修改图片和信息的显示
        //获得表
        int          dayId        = TimeUtil.getIntByDateTime(m_selectedDateTime);
        SignInConfig signInConfig = SignInMgr.GetInstance().GetConfigByID((uint)dayId);

        m_selectedLevelID = signInConfig.LevelId;
        LevelData   levelData   = LevelMgr.GetInstance().GetLevelConfig(m_selectedLevelID);
        LevelConfig levelConfig = levelData.Config;

        if (levelConfig == null)
        {
            Debug.LogError("获取不到关卡 " + m_selectedLevelID + " 的Config");
            return;
        }

        //TODO:修改mapIcon的图标,需要通过读表获取对应的图集
        AltasConfig altasConfig = AltasMgr.GetInstance().GetConfigByID(m_selectedLevelID);
        string      altasname   = altasConfig.AltasName2;
        UIAtlas     ats         = UIAtlasUtil.GetAtlas(altasname);

        if (ats != null)
        {
            ats.Sp = mapIcon;
            if (SignInMgr.GetInstance().IsSign(dayId - GameConfig.SignInDay))
            {
                ats.SetSprite("p_" + levelConfig.LevelPicture.ToString());
            }
            else
            {
                ats.SetSprite("s_" + levelConfig.LevelPicture.ToString());
            }
        }

        //TODO:修改info,包括了编号、名字、剩余时间和按钮的状态、文字等
        levelNumText.text = "#" + (SignInMgr.GetInstance().GetIndexByID((uint)dayId) + 1).ToString();
        LanguageMgr.GetInstance().GetLangStrByID(levelNameText, signInConfig.DailylevelName);

        StartCoroutine(TimeLeftUpdate(m_selectedDateTime.AddDays(1)));

        ModiTryButton();
    }
Esempio n. 12
0
 public void ClickChangeLanguage()
 {
     if (languageList.options[languageList.value].text == "简体中文")
     {
         LanguageMgr.GetInstance().SwitchLanguage(LangType.zh_Hans);
         //GameConfig.Language = LangType.zh_Hans;
     }
     else if (languageList.options[languageList.value].text == "繁體中文")
     {
         LanguageMgr.GetInstance().SwitchLanguage(LangType.zh_Hant);
     }
     else if (languageList.options[languageList.value].text == "English")
     {
         LanguageMgr.GetInstance().SwitchLanguage(LangType.en);
         //GameConfig.Language = LangType.en;
     }
     //GameConfig.Language = languageCheck ? LangType.zh_Hans : LangType.en;//多个语言下呢?要用toggle
     //Refresh();//languagemgr的逻辑已经改了,要调用LanguageMgr.SwitchLanguage
 }
Esempio n. 13
0
    private void ModiTryButton()
    {
        if (!TimeUtil.isNetworkOn())
        {
            UIGray.SetUIGray(tryButton.GetComponent <Image>());
            UIGray.SetUIGray(AdImgTrans.GetComponent <Image>());

            tryButton.interactable = false;
            tryButtonText.color    = Color.grey;
            UIMgr.GetInstance().ShowSimpleTips(306);
            return;
        }
        else
        {
            UIGray.Recovery(tryButton.GetComponent <Image>());
            UIGray.Recovery(AdImgTrans.GetComponent <Image>());

            tryButtonText.color    = normalTryButtonTextColor;
            tryButton.interactable = true;
        }

        if (m_selectedDateTime != DateTime.Today && !m_selectedDayObject.GetComponent <DayTest>().isChallenged)
        {
            //还需要读取多语言配置
            LanguageMgr.GetInstance().GetLangStrByID(tryButtonText, 304);//"挑战关卡"
            RectUtils.SetLeft(tryButtonText.GetComponent <RectTransform>(), 95);
            AdImgTrans.gameObject.SetActive(true);
        }
        else if (m_selectedDateTime == DateTime.Today)
        {
            LanguageMgr.GetInstance().GetLangStrByID(tryButtonText, 304);//"挑战关卡"
            RectUtils.SetLeft(tryButtonText.GetComponent <RectTransform>(), 10);
            AdImgTrans.gameObject.SetActive(false);
        }
        else
        {
            LanguageMgr.GetInstance().GetLangStrByID(tryButtonText, 305);//"再次挑战"

            RectUtils.SetLeft(tryButtonText.GetComponent <RectTransform>(), 10);
            AdImgTrans.gameObject.SetActive(false);
        }
    }
Esempio n. 14
0
 void ShowLeftTime(float timeNum)
 {
     ConfirmText.text = string.Format(LanguageMgr.GetInstance().ShowText(HiddenObjectKey.BeginTraining) + "({0})", Mathf.CeilToInt(timeNum).ToString());
 }
Esempio n. 15
0
 void Start()
 {
     m_txt = GetComponent <Text>();
     LanguageMgr.GetInstance().GetLangStrByID(m_txt, m_Lang_ID);
 }
Esempio n. 16
0
 private void Start()
 {
     Text_Message.text = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.QuitGameOrNot);
 }
Esempio n. 17
0
        /// <summary>
        /// Set the value of GameSetting
        /// </summary>
        void InitializeGameSettingData()
        {
            HOGGameSettingGenerator.Instance.CreateGameSetting();

            int _trainType = HOGGameSettingGenerator.Instance.GameSetting.TrainType;
            //int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.TrainType), out _trainType);
            int _gameCategory = HOGGameSettingGenerator.Instance.GameSetting.GameCategory;

            //int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.GameType), out _gameCategory);
            //int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.TrainTime), out _trainTime);

            #region GetStressValue
            int _stressValue    = 0;
            int _stressLevel    = 0;
            int _obstacleLength = 0;
            switch (_trainType)
            {
            case 2:
                int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.MaxAssist), out _stressValue);
                if (_stressValue == 100)
                {
                    _stressLevel = 1;
                }
                else if (_stressValue == 200)
                {
                    _stressLevel = 2;
                }
                else if (_stressValue == 300)
                {
                    _stressLevel = 3;
                }
                else if (_stressValue == 400)
                {
                    _stressLevel = 4;
                }
                else if (_stressValue == 500)
                {
                    _stressLevel = 5;
                }
                _trainTypeName = "Assistance";
                break;

            case 3:
                if (_gameCategory == 2)
                {
                    int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.ObstacleLength), out _obstacleLength);
                }
                int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.ActiveAssist), out _stressValue);
                if (_stressValue == 20)
                {
                    _stressLevel = 1;
                }
                else if (_stressValue == 35)
                {
                    _stressLevel = 2;
                }
                else if (_stressValue == 40)
                {
                    _stressLevel = 3;
                }
                else if (_stressValue == 55)
                {
                    _stressLevel = 4;
                }
                else if (_stressValue == 70)
                {
                    _stressLevel = 5;
                }
                _trainTypeName = "Active";
                break;

            case 4:
                if (_gameCategory == 3)
                {
                    int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.Mass), out _stressValue);
                    if (_stressValue == 60000)
                    {
                        _stressLevel = 1;
                    }
                    else if (_stressValue == 46000)
                    {
                        _stressLevel = 2;
                    }
                    else if (_stressValue == 34000)
                    {
                        _stressLevel = 3;
                    }
                    else if (_stressValue == 22000)
                    {
                        _stressLevel = 4;
                    }
                    else if (_stressValue == 10000)
                    {
                        _stressLevel = 5;
                    }
                    _trainTypeName = "Mass";
                }
                if (_gameCategory == 1)
                {
                    int.TryParse(GameSettingMgr.GetInstance().ShowValue(HiddenObjectKey.ResistiveAssist), out _stressValue);
                    if (_stressValue == 50)
                    {
                        _stressLevel = 1;
                    }
                    else if (_stressValue == 100)
                    {
                        _stressLevel = 2;
                    }
                    else if (_stressValue == 150)
                    {
                        _stressLevel = 3;
                    }
                    else if (_stressValue == 200)
                    {
                        _stressLevel = 4;
                    }
                    else if (_stressValue == 250)
                    {
                        _stressLevel = 5;
                    }
                    _trainTypeName = "Resistance";
                }
                break;

            default:
                break;
            }
            #endregion

            #region GetScoreDependOnStress
            string levelName = "Level" + _stressLevel;
            _minTargetScore = GlobalApplication.GetDataFromPropExpJson(_trainTypeName, levelName, "Min");
            _maxTargetScore = GlobalApplication.GetDataFromPropExpJson(_trainTypeName, levelName, "Max");
            #endregion

            #region SetRecorder
            _currentGameRecorder = new InGameRecord(_trainType);
            _currentGameRecorder.GameCategory   = _gameCategory;
            _currentGameRecorder.StressValue    = _stressValue;
            _currentGameRecorder.StressLevel    = _stressLevel;
            _currentGameRecorder.ObstacleLength = _obstacleLength;
            // Get level and exp.
            int playerLevel = 0;
            int.TryParse(PatientinfoMgr.GetInstance().ShowValue(HiddenObjectKey.Level), out playerLevel);
            _currentGameRecorder.PlayerLevel = playerLevel;
            int playerExp = 0;
            int.TryParse(PatientinfoMgr.GetInstance().ShowValue(HiddenObjectKey.Exp), out playerExp);
            _currentGameRecorder.PlayerExp = playerExp;
            _currentGameRecorder.GameLevel = 1;
            _currentGameRecorder.Score     = 0;
            _currentGameRecorder.LostTime  = 0;
            #endregion

            GetNextLevelExp(playerLevel);

            // Get Victory Message
            _victoryMessage = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.VictoryMessage).Split('#');

            // Get TimeUp Message
            _timeUpMessage = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.TimeUpMessage);

            // Get Target String
            _targetString = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.TargetString);

            // Get Reward String
            _rewardString = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.RandomReward);

            // Get TopBarTipMessage
            _topBarTipMessage = LanguageMgr.GetInstance().ShowText(HiddenObjectKey.TopBarTipMessage);
        }