public static void InvokeUseMedicalItem(GameObject obj, ItemType type, ref bool allow) { UseMedicalItem useMedicalItem = UseMedicalItemEvent; if (useMedicalItem == null) { return; } MedicalItemEvent ev = new MedicalItemEvent() { Player = Player.GetPlayer(obj), Item = type, Allow = allow }; useMedicalItem?.Invoke(ev); allow = ev.Allow; }
public static void InvokeCancelMedicalItem(GameObject player, ItemType itemType, ref float cooldown, ref bool allow) { if (CancelMedicalItemEvent == null) { return; } MedicalItemEvent ev = new MedicalItemEvent() { Player = player.GetPlayer(), Item = itemType, Cooldown = cooldown, Allow = allow }; CancelMedicalItemEvent.InvokeSafely(ev); cooldown = ev.Cooldown; allow = ev.Allow; }