修复 StreamingAssets/planner_config.json 残留 Piston/Electric 枚举值
This commit is contained in:
parent
9f682c9b91
commit
7413077514
@ -59,7 +59,7 @@ class FireUnit {
|
||||
```csharp
|
||||
class DroneWave {
|
||||
string WaveId; // 批次 ID
|
||||
DroneProfile Target; // 类型、数量、动力、翼展、速度、高度
|
||||
DroneProfile Profile; // 类型、数量、动力、翼展、速度、高度
|
||||
List<Waypoint> Waypoints; // 航路点
|
||||
float ArrivalTime; // 预计算:到达防御区域中点的时间 s
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ namespace CounterDrone.Unity
|
||||
Debug.Log($"2. ScenarioManager OK. scenario: {scenarioId}");
|
||||
|
||||
scenarioMgr.SaveScene(scenarioId, new CombatScene { WindSpeed = 0 });
|
||||
scenarioMgr.SaveDrone(scenarioId, new DroneProfile
|
||||
scenarioMgr.SaveDroneProfile(scenarioId, new DroneProfile
|
||||
{
|
||||
WaveId = "default",
|
||||
DroneType = (int)DroneType.FixedWing, PowerType = (int)PowerType.Piston,
|
||||
@ -56,7 +56,7 @@ namespace CounterDrone.Unity
|
||||
var droneGroup = new DroneWave
|
||||
{
|
||||
WaveId = "default",
|
||||
Drone = detail.Drones[0],
|
||||
Profile = detail.Drones[0],
|
||||
Route = detail.Routes[0],
|
||||
Waypoints = detail.WaypointGroups["default"],
|
||||
};
|
||||
@ -77,7 +77,7 @@ namespace CounterDrone.Unity
|
||||
PositionX = (droneGroup.Waypoints[0].PosX + droneGroup.Waypoints[^1].PosX) / 2,
|
||||
PositionY = (droneGroup.Waypoints[0].PosY + droneGroup.Waypoints[^1].PosY) / 2,
|
||||
PositionZ = (droneGroup.Waypoints[0].PosZ + droneGroup.Waypoints[^1].PosZ) / 2,
|
||||
DisperseHeight = droneGroup.Drone.TypicalAltitude,
|
||||
DisperseHeight = droneGroup.Profile.TypicalAltitude,
|
||||
});
|
||||
|
||||
var equips = new List<EquipmentDeployment>();
|
||||
|
||||
@ -82,7 +82,7 @@ namespace CounterDrone.Unity
|
||||
var planner = new DefensePlanner(ammoCatalog, PlannerConfig.Load(paths));
|
||||
var threats = new List<DroneWave>
|
||||
{
|
||||
new DroneWave { WaveId = "default", Drone = detail.Drones[0], Route = detail.Routes[0], Waypoints = detail.WaypointGroups["default"] }
|
||||
new DroneWave { WaveId = "default", Profile = detail.Drones[0], Route = detail.Routes[0], Waypoints = detail.WaypointGroups["default"] }
|
||||
};
|
||||
var fireUnits = new List<FireUnit>();
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
||||
@ -5,9 +5,7 @@
|
||||
"TypeCoefficient": {
|
||||
"HighSpeed": 4.0,
|
||||
"FixedWing": 2.0,
|
||||
"Piston": 2.0,
|
||||
"Rotor": 1.0,
|
||||
"Electric": 1.0
|
||||
"Rotor": 1.0
|
||||
},
|
||||
"AmmoMatch": {
|
||||
"Electric": "InertGas",
|
||||
|
||||
@ -198,7 +198,7 @@ namespace CounterDrone.Core.Tests
|
||||
[Fact]
|
||||
public void SaveDroneProfile_SavesCorrectly()
|
||||
{
|
||||
var scenario = _service.CreateScenario("Target Test", "");
|
||||
var scenario = _service.CreateScenario("Drone Test", "");
|
||||
_service.SaveDroneProfile(scenario.Id, new DroneProfile
|
||||
{
|
||||
WaveId = "default",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user