Android - sharedMaterial


I’m trying to modify a sharedMaterial so that the changes will be saved when opening the app again. This works perfectly within the windows editor. On Android it resets every time I close and reopen the app.

How can I permanently modify assets on Android?

Thanks for your help.

In compiled application assets are packed into a resources file, and you can’t modify anything inside this file.

To achieve what you need, you have to save the modified material info, e.g. using PlayerPrefs. When app is reopened, check if anything is saved. If yes, apply the change again.

For example, if you changed the material color, save this color RGBA values and after reopen, recreate a Color, and assign it to shared material.