I have tried the list given in Easy Save 2 examples and it work well
But I have created a list using the following code
Code: Select all
using UnityEngine;
using Serialization;
using System.Collections.Generic;
using System.Collections;
public class TestPositionListsES2 : MonoBehaviour
{
public List<pos> positions = new List<pos>();
List<pos> myOtherList = new List<pos>();
public class pos
{
private int _frame = Time.frameCount;
private float _time = Time.time;
public Vector3 position;
public Quaternion rotation;
public Vector3 velocity;
public Vector3 angularVelocity;
}
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void FixedUpdate() {
positions.Add(new pos { position = rigidbody.position, velocity = rigidbody.velocity,
angularVelocity = rigidbody.angularVelocity, rotation = rigidbody.rotation });
if (Input.GetKeyDown(KeyCode.Z))
{
ES2.Save(positions, "C:/MyFile.txt?tag=positions");
}
if (Input.GetKeyDown(KeyCode.A))
myOtherList = ES2.LoadList<pos>("C:/myFile.txt?tag=myList");
}
}
So my question is to know what I am doing wrong and what I can do to solve that problem.ES2TypeNotSupportedException: Easy Save does not support saving this type. If you are trying to load a collection such as a Dictionary or Array, use the collection classes (for example, LoadDictionary<>() or LoadArray<>()).
MoodkieWriter.Write (System.Object param)
MoodkieWriter.Write[pos] (System.Collections.Generic.List`1 param)
MoodkieSave.Save[pos] (System.Collections.Generic.List`1 param, .ES2Settings settings)
ES2.Save[pos] (System.Collections.Generic.List`1 param, System.String identifier)
TestPositionListsES2.FixedUpdate () (at Assets/Utilities/Scripts/TestPositionListsES2.cs:37)
Thanks in advance
Nicolas