示例#1
0
 public IEnumerable <Ray> ShotRays(WeaponDefinition weaponDefinition, Ray aimRay)
 {
     if (weaponDefinition.Type == WeaponType.Shotgun)
     {
         for (var i = 0; i < OsFps.ShotgunBulletsPerShot; i++)
         {
             var currentShotRay = MathfExtensions.GetRandomRayInCone(aimRay, weaponDefinition.ShotConeAngleInDegrees);
             yield return(currentShotRay);
         }
     }
     else
     {
         var shotRay = MathfExtensions.GetRandomRayInCone(aimRay, weaponDefinition.ShotConeAngleInDegrees);
         yield return(shotRay);
     }
 }