ASerializationVersionControl.cs 462 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using UnityEngine;
  3. namespace kt.Serialization
  4. {
  5. [Serializable]
  6. public abstract class ASerializationVersionControl : ISerializationCallbackReceiver
  7. {
  8. public ASerializationVersionControl()
  9. {
  10. this.version = this.FixVersion;
  11. }
  12. public abstract int FixVersion { get; }
  13. public virtual void OnAfterDeserialize()
  14. {
  15. }
  16. public virtual void OnBeforeSerialize()
  17. {
  18. this.version = this.FixVersion;
  19. }
  20. public int version;
  21. }
  22. }