Hi guys,this may be a little of topic because it is about a function of asset but maybe you guys can help me.It may also be a function of unity.
I have a problem,
I am using a Unity Serializer asset for saved games,it say’s here that
You also want to think “Are there things that shouldn’t be saved?” if the answer is yes then you want to add a DoNotSerialize attribute in front of each of those. You can also add this to a class and it will never be serialized, even if variables that hold instances of it say they can be.
You can specify that a particular behaviour should not be saved by adding a DontStore attribute to the class.
You can specify that all public properties should not be saved by using a [DoNotSerializePublic] attribute and then override particular fields or properties with [SerializeThis].
So in my list,I have a public Texture that cant be saved for some reason and if i load my save games the texture will dissapear so i need it to not touch the public texture so i added this.[DoNotSerialize]
[System.Serializable]
public class Buyable
{
public string name;
[DoNotSerialize]public Texture2d Chartexture;
public int Cost;
public int number;
public bool Unlocked;
public Texture2D Unlockedtexture;
public string Unlockedname;
}
But it still Serializing so i think i am misunderstanding it.If anyone knows how to fix this please reply.thanks