NativeColliderStatus.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using kt.Serialization;
  3. using UnityEngine;
  4. namespace kt.Physics
  5. {
  6. [Serializable]
  7. public class NativeColliderStatus : ASerializationVersionControl
  8. {
  9. public override int FixVersion
  10. {
  11. get
  12. {
  13. return 1000;
  14. }
  15. }
  16. public override void OnBeforeSerialize()
  17. {
  18. base.OnBeforeSerialize();
  19. if (this.onBeforeSerialize != null)
  20. {
  21. this.onBeforeSerialize();
  22. }
  23. }
  24. public override void OnAfterDeserialize()
  25. {
  26. base.OnAfterDeserialize();
  27. if (this.onAfterDeserialize != null)
  28. {
  29. this.onAfterDeserialize();
  30. }
  31. }
  32. [ReadOnly]
  33. public NativeColliderStatus.ColliderType colliderType;
  34. [HideInInspector]
  35. public string parentName;
  36. [HideInInspector]
  37. public string name;
  38. [HideInInspector]
  39. public Vector3 localPosition = Vector3.zero;
  40. [HideInInspector]
  41. public Quaternion localRotation = Quaternion.identity;
  42. [HideInInspector]
  43. public Vector3 localScale = Vector3.one;
  44. public Vector3 center = Vector3.zero;
  45. public NativeColliderStatus.Bound bound;
  46. [NonSerialized]
  47. public Action onBeforeSerialize;
  48. [NonSerialized]
  49. public Action onAfterDeserialize;
  50. public enum ColliderType
  51. {
  52. Plane,
  53. Capsule,
  54. Sphere,
  55. MaidPropCol
  56. }
  57. public enum Bound
  58. {
  59. Outside,
  60. Inside
  61. }
  62. }
  63. }