Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Multiple custom ICustomBootstrap specified

Discussion in 'Entity Component System' started by Phenotype, Nov 18, 2022.

  1. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    42
    Trying to implement my own ICustomBootstrap but receiving the above error. The error arises in:

    Unity.Entities.DefaultWorldInitialization

    static ICustomBootstrap CreateBootStrap()

    Line 376:

    Code (CSharp):
    1. else if (!bootType.IsAssignableFrom(selectedType))
    2.                     Debug.LogError("Multiple custom ICustomBootstrap specified, ignoring " + bootType);
    The conflict is with Netcode's ICustomBootstrap implementation.

    Obviously there is no point in offering the ICustomBootstrap interface if there can only be one and unity is going to use it. Is there is another way I can add to the bootstrap process without implementing this interface?
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,487
    You have to subclass ClientServerBootstrap. The loader will prefer the subclass over the base class.
     
    Phenotype likes this.
  3. Phenotype

    Phenotype

    Joined:
    Oct 26, 2010
    Posts:
    42
    That works but seems a bit of a hack. Now my bootstrapper has a dependency on netcode. Hopefully this will be changed. Thanks