/// <summary> /// order in /// 0 RCS /// 1 ECM /// 2 TARGET /// 3 RANGE /// /// </summary> public void SetStats(DoV_Vehicle Vehicle) { if (Vehicle != null) { GetBestOfClass(); Panel.VerticesDistances[0] = RCS = Vehicle.Rcs; Panel.VerticesDistances[1] = ECM = Vehicle.Ecm; Panel.VerticesDistances[2] = TargetTime = Vehicle.TargetTime; Panel.VerticesDistances[3] = FuelRange = Vehicle.FuelRange; Panel.VerticesDistances[4] = Instability = Vehicle.Instability; Panel.VerticesDistances[5] = ThermalRating = Vehicle.ThermalRating; Panel.SetAllDirty(); } }
public void GetBestOfClass() { var garageManager = FindObjectOfType <GarageManager>(); if (garageManager != null && Vehicle != null) { var currentVehicleType = Vehicle.BaseGroundType; var currentVehicleSubclass = Vehicle.GroundVehicleType; BestOfClassPanel.VerticesDistances[0] = garageManager.GarageCountryGovernment.Military.CountryMilitaryInventory.OrderBy(e => e.Vehicle.Rcs).FirstOrDefault(v => v.Vehicle.BaseGroundType == currentVehicleType && v.Vehicle.GroundVehicleType == currentVehicleSubclass).Vehicle.Rcs; BestOfClassPanel.VerticesDistances[1] = garageManager.GarageCountryGovernment.Military.CountryMilitaryInventory.OrderBy(e => e.Vehicle.Ecm).FirstOrDefault(v => v.Vehicle.BaseGroundType == currentVehicleType && v.Vehicle.GroundVehicleType == currentVehicleSubclass).Vehicle.Ecm; BestOfClassPanel.VerticesDistances[2] = garageManager.GarageCountryGovernment.Military.CountryMilitaryInventory.OrderBy(e => e.Vehicle.TargetTime).FirstOrDefault(v => v.Vehicle.BaseGroundType == currentVehicleType && v.Vehicle.GroundVehicleType == currentVehicleSubclass).Vehicle.TargetTime; BestOfClassPanel.VerticesDistances[3] = garageManager.GarageCountryGovernment.Military.CountryMilitaryInventory.OrderBy(e => e.Vehicle.FuelRange).FirstOrDefault(v => v.Vehicle.BaseGroundType == currentVehicleType && v.Vehicle.GroundVehicleType == currentVehicleSubclass).Vehicle.FuelRange; BestOfClassPanel.VerticesDistances[4] = garageManager.GarageCountryGovernment.Military.CountryMilitaryInventory.OrderBy(e => e.Vehicle.Instability).FirstOrDefault(v => v.Vehicle.BaseGroundType == currentVehicleType && v.Vehicle.GroundVehicleType == currentVehicleSubclass).Vehicle.Instability; BestOfClassPanel.VerticesDistances[5] = garageManager.GarageCountryGovernment.Military.CountryMilitaryInventory.OrderBy(e => e.Vehicle.ThermalRating).FirstOrDefault(v => v.Vehicle.BaseGroundType == currentVehicleType && v.Vehicle.GroundVehicleType == currentVehicleSubclass).Vehicle.ThermalRating; BestOfClassPanel.SetAllDirty(); } }
public void UpdateSensorOrientation() { var vehicle = FindObjectOfType <GarageManager>().SelectedDoV_CombatVehicle; if (vehicle == null) { return; } Vehicle = vehicle.Vehicle; UnitCallsign.text = Vehicle.DisplayName; LowAmmoWarning.gameObject.SetActive(false); LowFuelWarning.gameObject.SetActive(false); NoAmmoWarning.gameObject.SetActive(false); NoFuelWarning.gameObject.SetActive(false); float rotAmount = Mathf.Clamp(vehicle.Turret.transform.localEulerAngles.y, 0, 360f); float rotAmount2 = Mathf.Clamp(vehicle.Frame.transform.localEulerAngles.y, 0, 360f); FindObjectOfType <GarageManager>().DebugText.text = rotAmount.ToString(); if (vehicle.VehicleArmorState == ArmorState.ActiveDefenseDectecting) { MinSensorCircle.color = Colors.YellowGreen; } if (vehicle.VehicleArmorState == ArmorState.ActiveDefenseOnline) { MinSensorCircle.color = Colors.LimeGreen; } if (vehicle.VehicleArmorState == ArmorState.ActiveDefenseHit) { MinSensorCircle.color = Colors.OrangePeel; } if (vehicle.VehicleArmorState == ArmorState.ActiveDefenseMiss) { MinSensorCircle.color = Colors.LightYellow; } if (vehicle.VehicleArmorState == ArmorState.ActiveDefenseOffline) { MinSensorCircle.color = Colors.GraniteGray; } if (vehicle.VehicleArmorState == ArmorState.Damaged) { MinSensorCircle.color = Colors.OrangeRed; } if (vehicle.VehicleArmorState == ArmorState.Destoryed) { MinSensorCircle.color = Colors.Black; } if (vehicle.VehicleSenorState == SensorState.IsConfused) { MaxSensorCircle.color = Colors.GraniteGray; } if (vehicle.VehicleSenorState == SensorState.IsTracking) { MaxSensorCircle.color = Colors.LimeGreen; } if (vehicle.VehicleSenorState == SensorState.IsJammed) { MaxSensorCircle.color = Colors.RedCrayola; } if (vehicle.VehicleSenorState == SensorState.IsTargeted) { MaxSensorCircle.color = Colors.YellowGreen; } if (vehicle.VehicleWeaponState == WeaponState.IsTracking) { LookingAtDirectionMarker.color = Colors.LimeGreen; } if (vehicle.VehicleWeaponState == WeaponState.IsLockedOn) { LookingAtDirectionMarker.color = Colors.OrangePantone; } if (vehicle.VehicleWeaponState == WeaponState.IsFiring) { LookingAtDirectionMarker.color = Colors.RedCrayola; } if (vehicle.VehicleWeaponState == WeaponState.IsReloading) { LookingAtDirectionMarker.color = Colors.Bluebonnet; } if (vehicle.VehicleWeaponState == WeaponState.IsOutOfAmmo) { LookingAtDirectionMarker.color = Colors.GraniteGray; } float curRot = LookingAtDirectionMarker.rectTransform.localRotation.eulerAngles.z; float curRot2 = FacingDirectionMarker.rectTransform.localRotation.eulerAngles.z; FacingDirectionMarker.transform.localRotation = Quaternion.Euler(new Vector3(0, 0, vehicle.Frame.transform.localEulerAngles.y)); LookingAtDirectionMarker.transform.localRotation = Quaternion.Euler(new Vector3(0, 0, vehicle.Turret.transform.localEulerAngles.y)); LookingAtDirectionMarker.SetAllDirty(); }