예제 #1
0
    void LoadSetting()
    {
        var    bt      = File.ReadAllBytes(GetPath());
        string content = MTXXTea.DecryptToString(bt, SKEY); //File.ReadAllText(GetPath());
        // Debug.Log("get content " + content);
        MTJSONObject setJs = MTJSON.Deserialize(content);

        totalCoin = setJs.GetInt(SettingEnum.totalCoin.ToString(), 0);
        //Debug.Log("get totoal coin " + totalCoin);
        recordCoin = setJs.GetInt(SettingEnum.recordCoin.ToString(), 0);

        recordScore = setJs.GetInt(SettingEnum.recordScore.ToString(), 0);
        recordBomb  = setJs.GetInt(SettingEnum.recordBomb.ToString(), 0);
        recordRound = setJs.GetInt(SettingEnum.recordRound.ToString(), 0);
        recordMatch = setJs.GetInt(SettingEnum.recordMatch.ToString(), 0);
    }
예제 #2
0
    public static string Load(string fileName)
    {
        var path = Application.persistentDataPath + "/" + fileName;

        if (isEn)
        {
            var bt = FileUtil.ReadAllBytes(path);
            if (bt == null)
            {
                return("");
            }
            string content = MTXXTea.DecryptToString(bt, K);
            return(content);
        }
        else
        {
            return(File.ReadAllText(path));
        }
    }