コード例 #1
0
ファイル: PlayerEvents.cs プロジェクト: Killers0992/EXILED
        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;
        }
コード例 #2
0
        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;
        }