123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- using UnityEngine;
- namespace HQFPSWeapons
- {
- public enum DamageType
- {
- Generic,
- Cut,
- Hit,
- Stab,
- Bullet
- }
- /// <summary>
- ///
- /// </summary>
- public struct HealthEventData
- {
- /// <summary> </summary>
- public float Delta { get; set; }
- /// <summary> </summary>
- public LivingEntity Source { get; private set; }
- public DamageType DamageType { get; private set; }
- /// <summary> </summary>
- public Vector3 HitPoint { get; private set; }
- /// <summary> </summary>
- public Vector3 HitDirection { get; private set; }
- /// <summary> </summary>
- public float HitImpulse { get; private set; }
- /// <summary> </summary>
- public Vector3 HitNormal { get; private set; }
- public HealthEventData(float delta, LivingEntity source = null)
- {
- Delta = delta;
- DamageType = DamageType.Generic;
- HitPoint = Vector3.zero;
- HitDirection = Vector3.zero;
- HitImpulse = 0f;
- HitNormal = Vector3.zero;
- Source = source;
- }
- public HealthEventData(float delta, DamageType damageType, LivingEntity source = null)
- {
- Delta = delta;
- DamageType = damageType;
- HitPoint = Vector3.zero;
- HitDirection = Vector3.zero;
- HitImpulse = 0f;
- HitNormal = Vector3.zero;
- Source = source;
- }
- public HealthEventData(float delta, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, LivingEntity source = null)
- {
- Delta = delta;
- DamageType = DamageType.Generic;
- HitPoint = hitPoint;
- HitDirection = hitDirection;
- HitImpulse = hitImpulse;
- HitNormal = Vector3.zero;
- Source = source;
- }
- public HealthEventData(float delta, DamageType damageType, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, LivingEntity source = null)
- {
- Delta = delta;
- DamageType = damageType;
- HitPoint = hitPoint;
- HitDirection = hitDirection;
- HitImpulse = hitImpulse;
- HitNormal = Vector3.zero;
- Source = source;
- }
- public HealthEventData(float delta, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, Vector3 hitNormal, LivingEntity source = null)
- {
- Delta = delta;
- DamageType = DamageType.Generic;
- HitPoint = hitPoint;
- HitDirection = hitDirection;
- HitImpulse = hitImpulse;
- HitNormal = hitNormal;
- Source = source;
- }
- public HealthEventData(float delta, DamageType damageType, Vector3 hitPoint, Vector3 hitDirection, float hitImpulse, Vector3 hitNormal, LivingEntity source = null)
- {
- Delta = delta;
- DamageType = damageType;
- HitPoint = hitPoint;
- HitDirection = hitDirection;
- HitImpulse = hitImpulse;
- HitNormal = hitNormal;
- Source = source;
- }
- }
- }
|