Page 1 of 1

loading Queues in 3.3.1f8

Posted: Tue Jun 30, 2020 3:46 am
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 ?

Re: loading Queues in 3.3.1f8

Posted: Tue Jun 30, 2020 6:15 am
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

Re: loading Queues in 3.3.1f8

Posted: Tue Jun 30, 2020 1:41 pm
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 !

Re: loading Queues in 3.3.1f8

Posted: Tue Jun 30, 2020 6:28 pm
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