コード例 #1
0
    public static T LoadTable <T>(string tableName)
    {
        TextAsset table = AssetManager.Instance.Table.Retrieve(tableName);
        var       ret   = TableSerializer.Derialize <T>(table.bytes);

        return(ret);
    }
コード例 #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();
        }
    }
コード例 #3
0
    private static void LoadTable <T>(string tableName)
    {
        TextAsset table = AssetManager.Instance.Table.Retrieve(tableName);

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