DamageEvents.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace KairoEngine.CharacterSystem
  5. {
  6. public class DamageEvents
  7. {
  8. public static event System.Action<DamageData> OnDamage;
  9. public static event System.Action<DamageController, int> OnHeal;
  10. public static event System.Action<DamageController, CharacterController> OnDeath;
  11. public static void DamageEvent(DamageData damageData)
  12. {
  13. if(OnDamage != null)
  14. {
  15. //Debug.Log("ItemContainerEvents.OnOpen has been triggered");
  16. OnDamage(damageData);
  17. }
  18. }
  19. public static void HealEvent(DamageController damageController, int heal)
  20. {
  21. if(OnHeal != null)
  22. {
  23. //Debug.Log("ItemContainerEvents.OnOpen has been triggered");
  24. OnHeal(damageController, heal);
  25. }
  26. }
  27. public static void DeathEvent(DamageController damageController, CharacterController killedBy)
  28. {
  29. if(OnDeath != null)
  30. {
  31. //Debug.Log("ItemContainerEvents.OnOpen has been triggered");
  32. OnDeath(damageController, killedBy);
  33. }
  34. }
  35. }
  36. }