This works for me when creating a new world and spawning entities in it. The world only shows up when I call that last part of AppendWorldToCurrentPlayerLoop
var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default);
DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(myWorld, systems);
ScriptBehaviourUpdateOrder.AppendWorldToCurrentPlayerLoop(myWorld);
I tried to later call ScriptBehaviourUpdateOrder.RemoveWorldFromCurrentPlayerLoop(myWorld); and it does not remove the world from view. That world still renders all the entities. I know I can DestroyEntity in there to destroy them all, but I essentially just want to turn a world off. Is there a way to make that happen?
Second question is is there is a way to specify that a World will be visible or not to a specific camera? Something like adding a world to a render layer or being able to specify per camera which worlds to render.