Saving / Loading Material custom parameters and textures

Discussion and help for Easy Save 3
Post Reply
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

Saving / Loading Material custom parameters and textures

Post by friken »

Hi,

I'm wanting to run-time save material setups. I have a custom shader / material which has a ton of custom parameters floats/colors/textures. The normal material stuff. Unity has "presets" which would be perfect if they allowed material presets to be loaded at runtime but seems like that isn't an option for whatever reason. All the textures are in resources for runtime loading. I know that I can do this manually by knowing and saving the filenames of textures and loading them, but curious if there is a way to get Easy Save to do this w custom types and single LoadInto call? I'm saving the Material using this method but it doesn't seem to save any custom properties. It's a custom shader w a dozen textures / blend presets etc.... real pita to manually make a load/save system for them when I've experienced the magic of single call save/load w custom types (LOVE IT)!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving / Loading Material custom parameters and textures

Post by Joel »

Hi there,

I recommend taking a look at the ES3Type_Material.cs file in Plugins/Easy Save 3/Scripts/Types/Unity Types/, as this contains the logic we use to serialise Materials (including custom properties). This should give you a good idea of how to modify the ES3Type_Material to add further support for custom properties.

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