- Home /
Question by
Dimerk · Jan 01, 2015 at 01:39 PM ·
savemesh color
Save color changes made to mesh
Hi, i have a script that changes the color of a mesh in the editor (after pressing a button in the inspector). And it works fine. My problem right now is that the color of the mesh is resetet if i restart unity. Is there a way to save the changes made to the mesh ?
Happy new year ~Dime
Comment
Answer by AlucardJay · Jan 01, 2015 at 01:42 PM
Mesh colours are stored as vertex information in the mesh. You will need to create a new mesh asset, and use that.
http://docs.unity3d.com/ScriptReference/AssetDatabase.CreateAsset.html
Answer by jimmycrazyskills · Jan 01, 2015 at 03:20 PM
I think you can also set/get a PlayerPref(like a save file) for example,
//set your colour
PlayerPrefs.SetString( "col", Color);
//have some code to get your colour
return PlayerPrefs.GetString("col");
Your answer
![](https://koobas.hobune.stream/wayback/20220613175337im_/https://answers.unity.com/themes/thub/images/avi.jpg)