Problems with saving SpriteRenderers

Discussion and help for Easy Save 3
Post Reply
DeliInteractive
Posts: 9
Joined: Sat Feb 27, 2021 4:03 am

Problems with saving SpriteRenderers

Post by DeliInteractive »

We just bought the tool and we've found an issue with saving and loading GameObjects with SpriteRenderer components on them. In our case, we found that, when non-standard materials were attached to specific sprite renderers, the objects would load with untextured default materials. In attempting to test that with a new empty project, we came across an additional issue where the SpriteRenderer would load without a sprite even after assigning a sprite on the prefab thus altering the prefab itself. We've included a link to download the project here.

Our method:

1. Create prefab with an attached sprite renderer

2. Save and load the GameObject

3. Assigned sprite should be cleared and changed to none

[Link removed]
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Problems with saving SpriteRenderers

Post by Joel »

Hi there,

Please could you only send links to projects via private message in the future, as publicly sharing the Easy Save package is against the EULA.

Regarding this issue, this is because the Sprite is marked at NotEditable, and this was previously considered to mean that it was not serializable at runtime. However, if we're serializing it by reference then this isn't an issue, so I've created a version of Easy Save which ignores the NotEditable flag if storing by reference.

If you private message me your invoice number I will send this update over.

Regarding non-standard Materials, only the standard Material properties can be serialised at runtime, as there's no way of being able to automatically determine what properties a custom Material will have. In this case you would need to manually assign your Material to the object.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
treecki
Posts: 4
Joined: Wed Mar 24, 2021 12:49 am

Re: Problems with saving SpriteRenderers

Post by treecki »

I'm having a similar issue with being able to load Sprite Renderers. I know sprites are specifically saved by reference instead of by properties so I believe the issue has to due with a reference breaking with the object changing from one scene to the next. What was the specific solution to this issue with loading the sprites?
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Problems with saving SpriteRenderers

Post by Joel »

Hi there,

I've replied to your post in the other thread.

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