Page 1 of 1

References are not all saved

Posted: Thu May 04, 2023 8:45 am
by Sebastian1234123
Hello,

I'm obviously dumb as a brick.

I've been sitting on an obviously very stupid problem for days now.

I have a "mapManager", which has "Vehicle".

Code: Select all

[ES3Serializable] private List<Vehicle> vehicles = new List<Vehicle>();
(For testing: I also added the vehicles as GameObejct)

Code: Select all

[ES3Serializable] private List<GameObject> vehiclesGameobject = new List<GameObject>();
All possible prefab-vehicles are added to the reference manager.
Xnip2023-05-04_09-27-43.jpg
Xnip2023-05-04_09-27-43.jpg (349.07 KiB) Viewed 3034 times
The GameObject also has the es3 Prefab script
Xnip2023-05-04_09-30-24.jpg
Xnip2023-05-04_09-30-24.jpg (343.75 KiB) Viewed 3034 times


During the save of the information there are no errors logged.

This is the save manager:
Xnip2023-05-04_09-32-42.jpg
Xnip2023-05-04_09-32-42.jpg (176.13 KiB) Viewed 3034 times
I setted the "Reference depth" to 10. "Add all prefabs to manager" is true. "Auto update references" is active.

The save file only saves the references-id but not the data of the vehicle.

Code: Select all

			"vehicles" : [
				{
					"_ES3Ref" : "7386310704144569966"
				}
			],
I compared this with your example file (of the board) and there you save all settings/components of the object.

Of course i get an error at loading of the save file:
"Reference with ID 7199470260787816095 could not be found in Easy Save's reference manager. If you are loading objects dynamically (i.e. objects created at runtime), this warning is expected and can be ignored."

What do i do wrong?


Best regards,
Sebastian

Re: References are not all saved

Posted: Thu May 04, 2023 8:49 am
by Joel
Hi Sebastian,
The save file only saves the references-id but not the data of the vehicle.
Fields of reference types will be stored by reference. If you want to save the vehicle by value you should save the vehicle itself rather than a field containing references to them. You should do this before loading anything which references the vehicle to ensure a reference to it exists.

All the best,
Joel

Re: References are not all saved

Posted: Thu May 04, 2023 9:02 am
by Sebastian1234123
Perfect :)

Thx a lot. That was my problem.

(Btw. i will give you a 5 star rating at the asset-store for the very fast support and the good system!)

Re: References are not all saved

Posted: Thu May 04, 2023 12:45 pm
by Joel
Thanks, really appreciate it, glad that resolved your issue :)

All the best,
Joel