Exemple #1
0
        public static void InvokeOnLateShoot(ReferenceHub shooter, GameObject target, float damage, float distance, ref bool allow)
        {
            OnLateShoot onLateShoot = LateShootEvent;

            if (onLateShoot == null)
            {
                return;
            }

            LateShootEvent ev = new LateShootEvent()
            {
                Shooter  = shooter,
                Target   = target,
                Damage   = damage,
                Distance = distance,
                Allow    = allow
            };

            onLateShoot.Invoke(ref ev);
            allow = ev.Allow;
        }
        public static void InvokeOnLateShoot(ReferenceHub shooter, GameObject target, ref float damage, float distance, string hitboxType, ref bool allow)
        {
            if (LateShootEvent == null)
            {
                return;
            }

            LateShootEvent ev = new LateShootEvent()
            {
                Shooter    = shooter,
                Target     = target,
                Damage     = damage,
                Distance   = distance,
                HitboxType = hitboxType,
                Allow      = allow
            };

            LateShootEvent.InvokeSafely(ev);

            allow  = ev.Allow;
            damage = ev.Damage;
        }