Checkpoint 1:依赖锁定与运行开关落地
- 在 `SimulationWorld` 里添加 P2 运行开关 `UseJobSimulation` 与 `UseBurstJobs` - 添加依赖包: 1. burst: 1.8.28 2. collections: 2.5.7 3. Mathematics: 1.3.2 4. jobs(不单独成包) - 运行测试,均通过
This commit is contained in:
@@ -35,6 +35,8 @@ namespace Simulation
|
||||
}
|
||||
|
||||
[SerializeField] private bool _useSimulationMovement;
|
||||
[SerializeField] private bool _useJobSimulation;
|
||||
[SerializeField] private bool _useBurstJobs = true;
|
||||
|
||||
private EntitySync _entitySync;
|
||||
private Presentation _presentation;
|
||||
@@ -53,12 +55,24 @@ namespace Simulation
|
||||
public IReadOnlyList<ProjectileSimData> Projectiles => _projectiles;
|
||||
public IReadOnlyList<PickupSimData> Pickups => _pickups;
|
||||
public bool UseSimulationMovement => _useSimulationMovement;
|
||||
public bool UseJobSimulation => _useJobSimulation;
|
||||
public bool UseBurstJobs => _useBurstJobs;
|
||||
|
||||
public void SetUseSimulationMovement(bool enabled)
|
||||
{
|
||||
_useSimulationMovement = enabled;
|
||||
}
|
||||
|
||||
public void SetUseJobSimulation(bool enabled)
|
||||
{
|
||||
_useJobSimulation = enabled;
|
||||
}
|
||||
|
||||
public void SetUseBurstJobs(bool enabled)
|
||||
{
|
||||
_useBurstJobs = enabled;
|
||||
}
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
@@ -266,6 +280,17 @@ namespace Simulation
|
||||
return;
|
||||
}
|
||||
|
||||
if (_useJobSimulation)
|
||||
{
|
||||
// Checkpoint 1: the switch is in place; Checkpoint 3+ will replace this with jobified path.
|
||||
using (CustomProfilerMarker.TickEnemies.Auto())
|
||||
{
|
||||
TickEnemies(in context);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
using (CustomProfilerMarker.TickEnemies.Auto())
|
||||
{
|
||||
TickEnemies(in context);
|
||||
|
||||
Reference in New Issue
Block a user