I'm using a save system I don't fully understand but works well. It saves serializable code, but I started using ScriptableObjects as a way to save inventory and it broke and I don't know how to fix it now.
This is the code I'm using:
[CreateAssetMenu(fileName = "Attack")]
public class PlayerAttckCard : ScriptableObject
{
public string AtackName,bookName;
public bool multiTarget;
public float Bacepower;
public GameObject miniGame;
}
I tried using [System.Serializable]
but I got this error:
SerializationException: Type UnityEngine.ScriptableObject in assembly UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null is not marked as serializable.
Do I need to change how I'm saving my game or is there a way to fix this?