Save and Load Prefabs Instantiated at Runtime

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
Edu
Posts: 2
Joined: Tue Mar 12, 2019 8:04 pm

Save and Load Prefabs Instantiated at Runtime

Post by Edu »

I have two errors loading the example with the "PrefabManager" script,

1. int prefabCount = ES2.Load<int>(filename+"?tag=prefabCount");

The call is ambiguous between the following methods or properties 'ES2.Load<T>(string)' and 'ES3.Load<T>(string)'


2. ES2.Load.<Transform>(filename+"?tag="+tag, newPrefab.transform);


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

Re: Save and Load Prefabs Instantiated at Runtime

Post by Joel »

Hi there,

I don't seem to be getting any such errors in the example provided with Easy Save. Please could you let me know the exact example you are speaking of? If you downloaded it from somewhere, please could you let me know where it's downloaded from? If you could also send me a very basic project to replicate it, that would be appreciated.

I'm not sure how that error message makes sense, because the two methods are entirely different classes, so that error shouldn't apply.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Edu
Posts: 2
Joined: Tue Mar 12, 2019 8:04 pm

Re: Save and Load Prefabs Instantiated at Runtime

Post by Edu »

Hello.
Thank you for the prompt response, I managed to fix the error loading again the Easy Save Asset, but now I have the error of "The data you are trying to load does not match the Load method you are using to load it." I need to save and load the "Items" I'm adding in ScrollView, I'm using the Load_Save Script in the attached file.

Thanks for your help.

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

Re: Save and Load Prefabs Instantiated at Runtime

Post by Joel »

Hi there,

Please could you PM me the package in the future rather than attaching it here, otherwise you're sharing Easy Save publicly which is against the EULA.

Also as this question appears to be about Easy Save 2, not Easy Save 3, I will move this thread to the appropriate forum.

The error message means that the data saved to one of the tags is not of the same type as the generic parameter you've provided in the ES2.Load method.

I don't seem to see anywhere in your code where this is happening, which suggests that there might be data left over in your file. Deleting your save file will fix this, which you can do by going to Assets > Easy Save 2 > Settings > Tools > Open Default Save Folder, and delete the save file from there.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Locked