hadashiA / VContainer

The extra fast, minimum code size, GC-free DI (Dependency Injection) library running on Unity Game Engine.
https://vcontainer.hadashikick.jp
MIT License
1.92k stars 167 forks source link

[Bug] EntryPoint is called twice #686

Closed kochounoyume closed 3 months ago

kochounoyume commented 3 months ago

This phenomenon occurred in the latest version 1.16.0.

How to reproduce:

  1. Lay the scene over the hierarchy in this way before the game is played. image

  2. Place a LifetimeScope in each scene and associate it with a parent-child relationship setting. image image image

  3. Register EntryPoints with ChildLifetimeScope.

    
    using VContainer;
    using VContainer.Unity;

public sealed class ChildLifetimeScope : LifetimeScope { protected override void Configure(IContainerBuilder builder) { builder.RegisterEntryPoint(); } }


```cs
using UnityEngine;
using VContainer.Unity;

public sealed class EntryPointTest : IStartable
{
    void IStartable.Start()
    {
        Debug.Log("Startable!");
    }
}
  1. Play the game. image