How do i save materials?

Discussion and help for Easy Save 3
Post Reply
legendarykeith
Posts: 1
Joined: Mon Nov 11, 2019 9:10 pm

How do i save materials?

Post by legendarykeith »

Hello,
I'm trying to save materials with easy save but it's not working:

Material colour;
ES3.Save<Material>("colour", colour);

Am i doing this right?

Thanks,
Keith
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: How do i save materials?

Post by Joel »

Hi Keith,

That is correct, but be aware that properties of the shader which are not part of the standard Unity shaders will need to be saved separately. You can see what properties of the shader are saved by opening up the file at Assets/Plugins/Easy Save 3/Scripts/Types/Unity Types/ES3Type_Material.cs and looking at the list of properties being saved there.

Also is the Material generated at runtime? If you aren't procedurally generating the Material, you might only need to save a reference to it, rather than saving the entire Material itself. If you are modifying a few properties of the Material, it would also be more efficient to save a reference to the Material, and the values of it which get changes, and then save and load these.

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