ICustomBoostrap interface is different than in manual?

I’m using Entities 0.11.0 preview7;

Manual states that it is this:

public interface ICustomBootstrap
{
    // Returns the systems which should be handled by the default bootstrap process.
    // If null is returned the default world will not be created at all.
    // Empty list creates default world and entrypoints
    List<Type> Initialize(List<Type> systems);
}

However, real interface is this:

namespace Unity.Entities
{
  public interface ICustomBootstrap
  {
    bool Initialize(string defaultWorldName);
  }
}

What I’m missing? How to use it?

Systems aren’t pass in anymore, you can get the system list using
DefaultWorldInitialization.GetAllSystems()

Replicating default inintialization would look something like this

var world = new World(defaultWorldName);
World.DefaultGameObjectInjectionWorld = world;

var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default);

DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(world, systems);
ScriptBehaviourUpdateOrder.UpdatePlayerLoop(world);
1 Like

You using a very old Manual, i think it was changed back in version 0.2.
https://docs.unity3d.com/Packages/com.unity.entities@0.11/manual/world.html

1 Like

Right, thank you guys, I should rely on version toggle instead of google.

Edit:
Holdup, this page haven’t been updated either.
https://docs.unity3d.com/Packages/com.unity.entities@0.11/manual/system_update_order.html

What @tertle posted works though and should be in the manual instead.

It was mentioned in changelog

* `ICustomBootstrap` & `DefaultWorldInitialization` is now composable like this:
```
class MyCustomBootStrap : ICustomBootstrap
{
    public bool Initialize(string defaultWorldName)
    {
        Debug.Log("Executing bootstrap");
        var world = new World("Custom world");
        World.DefaultGameObjectInjectionWorld = world;
        var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default);

        DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(world, systems);
        ScriptBehaviourUpdateOrder.UpdatePlayerLoop(world);
        return true;
    }
}
```
1 Like