loading Queues in 3.3.1f8

Discussion and help for Easy Save 3
Post Reply
Ninin
Posts: 2
Joined: Tue Jun 30, 2020 3:01 am

loading Queues in 3.3.1f8

Post by Ninin »

Hello,

I have a problem with ES3.Load for the following :

Code: Select all

players = ES3.Load<Queue<GameObject>>("availablePlayers", currentPath);
However it seems to work with a direct cast :

Code: Select all

players = (Queue<GameObject>)ES3.Load("availablePlayers", currentPath);
There is a commented part inside the Read<T>(ES3Reader) Method in the ES3QueueType class. May come from here ?

User avatar
Joel
Moodkie Staff
Posts: 2802
Joined: Wed Nov 07, 2012 10:32 pm

Re: loading Queues in 3.3.1f8

Post by Joel »

Hi there,

I don't appear to be able to replicate this at my end. Please could you show me the code your're using to save?

Note the code I'm using to test this is as follows:

Code: Select all

var queue = new Queue<GameObject>();
queue.Enqueue(gameObject);
ES3.Save("queue", queue, "queue.es3");
//This also works as expected: ES3.Save<Queue<GameObject>>("queue", queue, "queue.es3");
var loaded = ES3.Load<Queue<GameObject>>("queue", "queue.es3");
Debug.Log(loaded.Count);
All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity

Ninin
Posts: 2
Joined: Tue Jun 30, 2020 3:01 am

Re: loading Queues in 3.3.1f8

Post by Ninin »

I cannot replicate it as well today, I switch back to the usual form and it seems to work normally. Maybe it's because of the Easy Save version upgrade I've done before.
I use this code to save :

Code: Select all

ES3.Save<Queue<GameObject>>("availablePlayers", runtimeGameProgress.availablePlayers, currentPath);
Anyway, thanks for the quick answer !

User avatar
Joel
Moodkie Staff
Posts: 2802
Joined: Wed Nov 07, 2012 10:32 pm

Re: loading Queues in 3.3.1f8

Post by Joel »

Glad it's working for you now, please do let me know if you manage to replicate it again.

All the best,
Joel
Joel @ Moodkie Interactive
Twitter - Unity

Post Reply