HealthEventData.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using UnityEngine;
  2. namespace HQFPSWeapons
  3. {
  4. public enum DamageType
  5. {
  6. Generic,
  7. Cut,
  8. Hit,
  9. Stab,
  10. Bullet
  11. }
  12. /// <summary>
  13. ///
  14. /// </summary>
  15. public struct HealthEventData
  16. {
  17. /// <summary> </summary>
  18. public float Delta { get; set; }
  19. /// <summary> </summary>
  20. public LivingEntity Source { get; private set; }
  21. public DamageType DamageType { get; private set; }
  22. /// <summary> </summary>
  23. public Vector3 HitPoint { get; private set; }
  24. /// <summary> </summary>
  25. public Vector3 HitDirection { get; private set; }
  26. /// <summary> </summary>
  27. public float HitImpulse { get; private set; }
  28. /// <summary> </summary>
  29. public Vector3 HitNormal { get; private set; }
  30. public HealthEventData(float delta, LivingEntity source = null)
  31. {
  32. Delta = delta;
  33. DamageType = DamageType.Generic;
  34. HitPoint = Vector3.zero;
  35. HitDirection = Vector3.zero;
  36. HitImpulse = 0f;
  37. HitNormal = Vector3.zero;
  38. Source = source;
  39. }
  40. public HealthEventData(float delta, DamageType damageType, LivingEntity source = null)
  41. {
  42. Delta = delta;
  43. DamageType = damageType;
  44. HitPoint = Vector3.zero;
  45. HitDirection = Vector3.zero;
  46. HitImpulse = 0f;
  47. HitNormal = Vector3.zero;
  48. Source = source;
  49. }
  50. public HealthEventData(float delta, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, LivingEntity source = null)
  51. {
  52. Delta = delta;
  53. DamageType = DamageType.Generic;
  54. HitPoint = hitPoint;
  55. HitDirection = hitDirection;
  56. HitImpulse = hitImpulse;
  57. HitNormal = Vector3.zero;
  58. Source = source;
  59. }
  60. public HealthEventData(float delta, DamageType damageType, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, LivingEntity source = null)
  61. {
  62. Delta = delta;
  63. DamageType = damageType;
  64. HitPoint = hitPoint;
  65. HitDirection = hitDirection;
  66. HitImpulse = hitImpulse;
  67. HitNormal = Vector3.zero;
  68. Source = source;
  69. }
  70. public HealthEventData(float delta, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, Vector3 hitNormal, LivingEntity source = null)
  71. {
  72. Delta = delta;
  73. DamageType = DamageType.Generic;
  74. HitPoint = hitPoint;
  75. HitDirection = hitDirection;
  76. HitImpulse = hitImpulse;
  77. HitNormal = hitNormal;
  78. Source = source;
  79. }
  80. public HealthEventData(float delta, DamageType damageType, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, Vector3 hitNormal, LivingEntity source = null)
  81. {
  82. Delta = delta;
  83. DamageType = damageType;
  84. HitPoint = hitPoint;
  85. HitDirection = hitDirection;
  86. HitImpulse = hitImpulse;
  87. HitNormal = hitNormal;
  88. Source = source;
  89. }
  90. }
  91. }