Not sure if you are looking for this, but you can exclude your classes from serialization by specifying [NonSerialized] before the class definition. Therefore, if you want to exclude a specific type, you will have to inherit it and create your own class
[NonSerialized] public class Point { public int x, y; }
source share