public static double GetDouble(string key, double defaultValue = 0f)
    {
        string value  = EncryptionManager.GetString(key, defaultValue.ToString());
        double result = defaultValue;

        double.TryParse(value, out result);
        return(result);
    }
    public static int GetInt(string key, int defaultValue = 0)
    {
        string value  = EncryptionManager.GetString(key, defaultValue.ToString());
        int    result = defaultValue;

        int.TryParse(value, out result);
        return(result);
    }
Exemplo n.º 3
0
        static public bool IsNewGame()
        {
            string strKey = "newGame";

            if (EncryptionManager.GetString(strKey, "0") != "1")
            {
                EncryptionManager.SetString(strKey, "1");
                EncryptionManager.Save();
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
    public static void Init()
    {
        instance = new GuideManager();
        DataManager.Instance.addData("guideData", instance.data);

        string num = EncryptionManager.GetString("guideNum");

        if (num == "")
        {
            num = "1";
        }
        instance.SetGuideNum(num);
    }
Exemplo n.º 5
0
 static public bool IsSaveKey(string key, string value, bool isSave = true)
 {
     if (EncryptionManager.GetString(key, "") != value)
     {
         if (isSave)
         {
             EncryptionManager.SetString(key, value);
             EncryptionManager.Save();
         }
         return(false);
     }
     return(true);
 }
Exemplo n.º 6
0
        static public bool IsNewDay(string key, bool isSave = true)
        {
            string strKey  = "IsNewDay" + key;
            string timeKey = DateTime.Now.ToShortDateString().ToString();

            if (EncryptionManager.GetString(strKey, "") != timeKey)
            {
                if (isSave)
                {
                    SaveNewDay(key);
                }
                return(true);
            }
            return(false);
        }
Exemplo n.º 7
0
    // Start is called before the first frame update
    protected override void Start()
    {
        base.Start();

        string musicN = EncryptionManager.GetString(GameBaseStatus.Instance.GetRunSceneName() + "bgMusicName", "");

        if (musicN != "")
        {
            //BgMusicManager.Instance.UpdateMusic(musicN, 0.5f);
            PlayMusic(musicN);
        }
        else
        {
            PlayMusic(0);
        }
    }
    private static string GetLanguage()
    {
        instance.userLanguage = EncryptionManager.GetString("userLanguage");
        if (instance.userLanguage != "")
        {
            return(instance.userLanguage);
        }

        switch (Application.systemLanguage)
        {
        case SystemLanguage.Chinese:
        case SystemLanguage.ChineseSimplified:
            return("Chinese");

        case SystemLanguage.ChineseTraditional:
            return("ChineseTraditional");

        case SystemLanguage.Russian:
        case SystemLanguage.Belarusian:
            return("Russian");   //俄语

        case SystemLanguage.Arabic:
            return("Arabic");   //阿拉伯语

        case SystemLanguage.French:
            return("French");   //法语

        case SystemLanguage.German:
            return("German");   //德语

        case SystemLanguage.Indonesian:
            return("Indonesia");   //印尼语

        case SystemLanguage.Japanese:
            return("Japanese");   //日语

        case SystemLanguage.Korean:
            return("Korean");   //韩语

        case SystemLanguage.Ukrainian:
            return("Ukrainian");   //乌克兰语

        case SystemLanguage.Afrikaans:
        case SystemLanguage.Basque:
        case SystemLanguage.Bulgarian:
        case SystemLanguage.Catalan:
        case SystemLanguage.Czech:
        case SystemLanguage.Danish:
        case SystemLanguage.Dutch:
        case SystemLanguage.English:
        case SystemLanguage.Estonian:
        case SystemLanguage.Faroese:
        case SystemLanguage.Finnish:
        case SystemLanguage.Greek:
        case SystemLanguage.Hebrew:
        case SystemLanguage.Icelandic:
        case SystemLanguage.Italian:
        case SystemLanguage.Latvian:
        case SystemLanguage.Lithuanian:
        case SystemLanguage.Norwegian:
        case SystemLanguage.Polish:
        case SystemLanguage.Portuguese:
        case SystemLanguage.Romanian:
        case SystemLanguage.SerboCroatian:
        case SystemLanguage.Slovak:
        case SystemLanguage.Slovenian:
        case SystemLanguage.Spanish:
        case SystemLanguage.Swedish:
        case SystemLanguage.Thai:
        case SystemLanguage.Turkish:
        case SystemLanguage.Vietnamese:
        case SystemLanguage.Unknown:
            return("English");
        }
        return("English");
    }