Ejemplo n.º 1
0
    public T Decode <T>()
    {
        string         path = Path.Combine(Application.persistentDataPath, _fileName);
        PersistentSave ps   = new PersistentSave(_fileName);

        if (!File.Exists(path))
        {
            StreamimgSave ss   = new StreamimgSave(_fileName);
            T             data = ss.LoadbyJson <T>();
            // 未处理配置文件不存在的情况
            ps.SaveByBin <T>(data);
        }

        return(ps.LoadByBin <T>());
    }
Ejemplo n.º 2
0
    // 数据保存
    public bool Encode <T>(T s)
    {
        PersistentSave ps = new PersistentSave(_fileName);

        return(ps.SaveByBin <T>(s));
    }