public World BackupWorld() { var world = new World("lockStepWorld", WorldFlags.Simulation); world.EntityManager.CopyAndReplaceEntitiesFrom(activeWorld.EntityManager); world.SetTime(new Unity.Core.TimeData(activeWorld.Time.ElapsedTime, activeWorld.Time.DeltaTime)); return(world); }
public void CopyWorld(World toWorld, World fromWorld) { //snapShotWorld.EntityManager.DestroyAndResetAllEntities(); toWorld.EntityManager.CopyAndReplaceEntitiesFrom(fromWorld.EntityManager); toWorld.SetTime(new Unity.Core.TimeData(fromWorld.Time.ElapsedTime, fromWorld.Time.DeltaTime)); }