public static T LoadTable <T>(string tableName)
    {
        TextAsset table = AssetManager.Instance.Table.Retrieve(tableName);
        var       ret   = TableSerializer.Derialize <T>(table.bytes);

        return(ret);
    }
Beispiel #2
0
    public static void Load()
    {
        string       savePath = Util.GetDataPath(LocalData.SaveFileName);
        StreamReader sr       = null;

        try
        {
            if (false == System.IO.File.Exists(savePath))
            {
                Save();
            }

            sr = new StreamReader(savePath);

            s_intance = (LocalData)TableSerializer.Derialize <LocalData>(sr);
            sr.Close();
            sr = null;
        }
        catch (System.Exception e)
        {
            if (null != sr)
            {
                sr.Close();
            }

            System.IO.File.Delete(savePath);
            Debug.Log("LocalSaveData Load Exception : " + e.Message);
            s_intance = new LocalData();
        }
    }
    private static void LoadTable <T>(string tableName)
    {
        TextAsset table = AssetManager.Instance.Table.Retrieve(tableName);

        TableSerializer.Derialize <T>(table.bytes);
    }