Multiple same type components

Discussion and help for Easy Save 3
Post Reply
hefaust
Posts: 4
Joined: Mon Jun 01, 2020 8:26 am

Multiple same type components

Post by hefaust »

Hello,

Is there anyway or workaround to save and load game object with multiple same type components?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Multiple same type components

Post by Joel »

Hi there,

In this case you would need to save the Components separately and assign the appropriate data to the appropriate Component using ES3.LoadInto. I.e.

Code: Select all

ES3.Save("components", gameObject.GetComponents<MyScript>());

ES3.LoadInto("components", gameObject.GetComponents<MyScript>());
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
hefaust
Posts: 4
Joined: Mon Jun 01, 2020 8:26 am

Re: Multiple same type components

Post by hefaust »

Hi Joel,

Thanks for quick response! I think I can come up with a solution using LoadInto. In the attached image you can see a thing I'm trying to save. Two physics objects are connected with Joints, those joints are added by player during playtime, and they do not exist in the prefab. Joint must be on the same game object, because they depends on rigidbody. So I probably should add these joint components to the object before I load into them. This is probably only way to do it?

Untitled - 2.png
Untitled - 2.png (8.49 KiB) Viewed 1396 times
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Multiple same type components

Post by Joel »

From what I can tell this would be the best way of doing it.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
hefaust
Posts: 4
Joined: Mon Jun 01, 2020 8:26 am

Re: Multiple same type components

Post by hefaust »

OK, thank you!
Post Reply