static void Main(string[] args) { var rifleInfo = new RifleInfo { Name = "My Rifle", BarrelTwist = Length.FromInches(11.25), //1:11.25 ZeroingConditions = new WeatherCondition { Altitude = Length.FromMeters(0), //sea level Barometer = Pressure.FromPsi(14.7), //sea level RelativeHumidity = 0.5, //in percentage from 0.0 to 1.0 (0% - 100%) Temperature = Temperature.FromDegreesCelsius(30) } }; var ammoInfo = new Cartridge { MuzzleVelocity = Speed.FromMetersPerSecond(790), BC = 0.505, DragFunction = DragFunction.G1, Name = "My Ammo", WeightGrains = 175, Length = Length.FromInches(1.240), Caliber = Length.FromInches(0.308) }; var scopeInfo = new Scope { Name = "My Scope", Height = Length.FromCentimeters(4), ZeroDistance = Length.FromMeters(100), ElevationClicksPerMOA = 1, WindageClicksPerMOA = 0.5 }; var locationInfo = new ShotLocationInfo { Latitude = 45, //degrees ShotAzimuth = 270 //degrees -> west }; var currentWeatherConditions = new WeatherCondition { Altitude = Length.FromMeters(0), //sea level Barometer = Pressure.FromPsi(14.7), //sea level RelativeHumidity = 0.5, //in percentage from 0.0 to 1.0 (0% - 100%) Temperature = Temperature.FromDegreesCelsius(30) }; var rifle = new Rifle(rifleInfo, scopeInfo, ammoInfo); var solution = rifle.Solve( 0.0, //shooting angle Speed.FromKilometersPerHour(10), 90, //wind direction angle (degrees) Length.FromMeters(500), currentWeatherConditions, locationInfo); }
void Start() { rifleController = rifleGameObject.GetComponent <RifleController> (); rifleInfo = rifleGameObject.GetComponent <RifleInfo> (); playerRigidbody = GetComponent <Rigidbody> (); startScale = playerSpriteGameObject.transform.localScale; isInvincibility = false; playerSpriteRenderer = playerSpriteGameObject.GetComponent <SpriteRenderer> (); spriteStartColor = playerSpriteRenderer.color; spriteCurrentColor = spriteStartColor; }
void Start() { life = 3; exp = 0; maxLife = 3; maxExp = 5; playerController = GetComponent <PlayerController> (); rifleInfo = FindObjectOfType <RifleInfo> (); uiLife = FindObjectOfType <UILife> (); uiExp = FindObjectOfType <UIExp> (); }
void Start() { rifleInfo = GetComponent <RifleInfo> (); mouseGameObject = GameObject.FindWithTag("Mouse"); }