Open amenonegames opened 6 months ago
Your class Sample must be registered by RegisterEntryPoint, cause it have IStartable interface
Oh, sorry for my miss registration. But I confirmed by debugger start medhod was called in that code.
And now I tried again with following containerbuilder. But the same thing happened...
public class SampleContainerBuilder : LifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
builder.RegisterEntryPoint<SampleTick>(Lifetime.Transient)
.AsImplementedInterfaces()
.AsSelf();
builder.RegisterEntryPoint<Sample>();
}
}
Injected Tickable Instance don't run Tick method, when class is registerd as Lifetime.Transient,
Maybe because create new instance when EntryPointDispatcher runs, and register it as TickableLoopItem.
Then, only new instance's Tick medhod called in TickableLoopItem's MoveNext. Other instance injected the classes is not called.
Following is simple testcode. I expected display log "edited from Sample class". But acturally displayed "empty".
== my environment== Unity 2022.3.10f1 VContainer 1.13.2 and 1.14.0 (This occured both version) using SourceGeneratorDLL