Exemplo n.º 1
0
    //反序列化;
    public T DeserializeFromFile <T>(string path)
    {
        UnityEngine.Object asset = AssetDatabase.LoadMainAssetAtPath(path);
        TextAsset          ta    = TextAsset.Instantiate(asset) as TextAsset;
        string             json  = ta.text;

        return((T)JsonReader.Deserialize(json, typeof(T)));
    }