ICloudDispersionModel加Phase属性 + 帧数据输出扩散阶段
This commit is contained in:
parent
202e5ee117
commit
bb0a2454df
@ -25,6 +25,7 @@ namespace CounterDrone.Core.Algorithms
|
||||
public float EffectiveRadius => _currentRadius;
|
||||
public ParticleParams Particles { get; } = new();
|
||||
public bool IsDissipated { get; private set; }
|
||||
public int Phase => _inPhase3 ? 3 : (_elapsed < 0.01f ? 1 : 2);
|
||||
|
||||
public void Initialize(AmmunitionSpec ammo, CombatScene env, Vector3 releasePos, float releaseTime)
|
||||
{
|
||||
|
||||
@ -13,5 +13,7 @@ namespace CounterDrone.Core.Algorithms
|
||||
float EffectiveRadius { get; }
|
||||
ParticleParams Particles { get; }
|
||||
bool IsDissipated { get; }
|
||||
/// <summary>当前扩散阶段:1=爆轰膨胀, 2=湍流扩散, 3=高斯扩散</summary>
|
||||
int Phase { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ namespace CounterDrone.Core.Simulation
|
||||
foreach (var d in _drones)
|
||||
list.Add(new EntitySnapshot { EntityId = d.Id, EntityType = Models.EntityType.Drone, PosX = d.PosX, PosY = d.PosY, PosZ = d.PosZ, StateData = JsonSerializer.Serialize(new { damageStage = (int)_damageModel.GetDamageStage(1 - d.Hp), hp = d.Hp }) });
|
||||
foreach (var c in _clouds)
|
||||
list.Add(new EntitySnapshot { EntityId = c.Id, EntityType = Models.EntityType.Cloud, PosX = c.Dispersion.Center.X, PosY = c.Dispersion.Center.Y, PosZ = c.Dispersion.Center.Z, StateData = JsonSerializer.Serialize(new { radius = c.Dispersion.Radius, opacity = c.Dispersion.Particles.Opacity }) });
|
||||
list.Add(new EntitySnapshot { EntityId = c.Id, EntityType = Models.EntityType.Cloud, PosX = c.Dispersion.Center.X, PosY = c.Dispersion.Center.Y, PosZ = c.Dispersion.Center.Z, StateData = JsonSerializer.Serialize(new { radius = c.Dispersion.Radius, opacity = c.Dispersion.Particles.Opacity, phase = c.Dispersion.Phase }) });
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user