示例#1
0
        public static void InvokeOnShoot(ReferenceHub shooter, GameObject target, ref bool allow)
        {
            OnShoot onShoot = ShootEvent;

            if (onShoot == null)
            {
                return;
            }
            ShootEvent ev = new ShootEvent
            {
                Shooter = shooter,
                Allow   = allow,
                Target  = target
            };

            onShoot.Invoke(ref ev);
            allow = ev.Allow;
        }
示例#2
0
        public static void InvokeOnShoot(ReferenceHub shooter, GameObject target, ref bool allow, ref Vector3 targetPosition)
        {
            if (ShootEvent == null)
            {
                return;
            }

            ShootEvent ev = new ShootEvent
            {
                Shooter   = shooter,
                Allow     = allow,
                Target    = target,
                TargetPos = targetPosition
            };

            ShootEvent.InvokeSafely(ev);

            allow          = ev.Allow;
            targetPosition = ev.TargetPos;
        }