public static void CreateItemTypeVpCustomType() { DoV_Vehicle asset = (DoV_Vehicle)CreateAsset(countryFlag, typeof(DoV_Vehicle)); if (asset != null) { asset.DisplayName = "custom"; } }
/// <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 float CalculateSensorDelay(DoV_Vehicle Vehicle) { var delay = 0; Vehicle.VehicleSensors.ForEach(sensor => { if (sensor.IsJammingDevice || sensor.IsElectronicWarfare) { JammingSensors.Add(sensor); } else { DetectorSesnors.Add(sensor); } }); return(delay); }
public void SetSelectedUnitUI(DoV_Vehicle DoV) { SelectedUnitName.text = DoV.Name; SelectedDisplayName.text = DoV.DisplayName; SelectedType.texture = DoV.ClassIcon; SelectedCountryFlag.texture = DoV.CountryOfOriginFlag; SelectedVehicleMapNATOIcon.texture = DoV.MapIcon; var statsPanel = FindObjectOfType <StatsInfoPanel>(); var statsCube = FindObjectOfType <StatsCubePanel>(); var sensorPanel = FindObjectOfType <SensorPanel>(); var weaponsconfig = FindObjectOfType <WeaponsConfigPanel>(); sensorPanel.Vehicle = statsCube.Vehicle = statsPanel.Vehicle = DoV; SelectedDoV_Vehicle = DoV; SelectedDoV_CombatVehicle = FindObjectOfType <DoV_CombatVehicle>(); SelectedDoV_CombatVehicle.Vehicle = DoV; statsCube.SetStats(DoV); statsPanel.SetStats(); sensorPanel.SetSensorPanel(); weaponsconfig.SetTabWeaponConfig(); VehicleListPanel.SetActive(false); }
public float GetMinWeaponRange(DoV_Vehicle Vehicle) { return(Vehicle.VehicleSensors.Min(e => e.MaxRange)); }
public void AddUnitToDeck(DoV_Vehicle vehicle, DeckDataItem deck) { deck.VehiclesInDeck.Add(vehicle); }
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(); }