Пример #1
0
 public override void Tick(float deltaTime)
 {
     float range = GetRange();
     
     if (_target == null)
     {
         _target = _targetFinder.FindTarget(gameObject, Physics2D.OverlapCircleAll(transform.position, range, TargetLayer).Where(x => IsWithinRange(x.transform, range)));
         if (_target != null)
         {
             _onTargetAcquired.CallEvent(new Modification.Events.EventArgs(this, _target));
         }
     }
     if (_target && !IsWithinRange(_target, range))
     {
         _target = null;
     }
 }
 private void Weapon_OnProjectile(IProjectile proj)
 {
     OnProjectile.CallEvent(new Modification.Events.EventArgs(this, proj));
 }
 private void Weapon_OnProjectileHit(HitInfo obj)
 {
     OnProjectileHit.CallEvent(new Modification.Events.EventArgs(this, obj));
 }
 private void Weapon_OnFire(IProjectile[] projs)
 {
     OnFire.CallEvent(new Modification.Events.EventArgs(this, projs));
 }