- 修复 EntityBinding.cs 的字典不一致问题
This commit is contained in:
parent
dedd07e187
commit
200277a703
|
|
@ -32,6 +32,12 @@ namespace Simulation
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_simulationIndexToEntityId.TryGetValue(newSimulationIndex, out int oldEntityId) &&
|
||||||
|
oldEntityId != entityId)
|
||||||
|
{
|
||||||
|
_entityIdToSimulationIndex.Remove(oldEntityId);
|
||||||
|
}
|
||||||
|
|
||||||
_simulationIndexToEntityId.Remove(oldSimulationIndex);
|
_simulationIndexToEntityId.Remove(oldSimulationIndex);
|
||||||
_entityIdToSimulationIndex[entityId] = newSimulationIndex;
|
_entityIdToSimulationIndex[entityId] = newSimulationIndex;
|
||||||
_simulationIndexToEntityId[newSimulationIndex] = entityId;
|
_simulationIndexToEntityId[newSimulationIndex] = entityId;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue