예제 #1
0
 public void HandleFrame(UpdateBulletEvent e, BulletNode bulletNode)
 {
     BulletComponent bullet = bulletNode.bullet;
     BulletConfigComponent bulletConfig = bulletNode.bulletConfig;
     DirectionData data = e.TargetingData.Directions[0];
     if (data.StaticHit != null)
     {
         Vector3 position = data.StaticHit.Position;
         base.ScheduleEvent(new RicochetBulletBounceEvent(position), bulletNode);
         bullet.Distance += (bullet.Position - data.StaticHit.Position).magnitude;
         this.ProcessRicochet(bullet, data.StaticHit);
     }
     else
     {
         if (base.DestroyOnAnyTargetHit(bulletNode.Entity, bullet, bulletConfig, e.TargetingData))
         {
             return;
         }
         base.MoveBullet(bulletNode.Entity, bullet);
     }
     if (bullet.Distance > bulletConfig.FullDistance)
     {
         base.DestroyBullet(bulletNode.Entity);
     }
 }
예제 #2
0
        public void HandleFrame(UpdateBulletEvent e, BulletNode bulletNode)
        {
            BulletComponent       bullet       = bulletNode.bullet;
            BulletConfigComponent bulletConfig = bulletNode.bulletConfig;
            DirectionData         data         = e.TargetingData.Directions[0];

            if (data.StaticHit != null)
            {
                bullet.Distance += (bullet.Position - data.StaticHit.Position).magnitude;
                base.SetPositionNearHitPoint(bullet, data.StaticHit.Position);
                base.SendBulletStaticHitEvent(bulletNode.Entity, bullet);
                base.DestroyBullet(bulletNode.Entity);
            }
            else if (!base.DestroyOnAnyTargetHit(bulletNode.Entity, bullet, bulletConfig, e.TargetingData))
            {
                base.MoveBullet(bulletNode.Entity, bullet);
                if (bullet.Distance > bulletConfig.FullDistance)
                {
                    base.DestroyBullet(bulletNode.Entity);
                }
            }
        }