Skip to content

IStartable.Start() が例外で繰り返し実行される / Unexpected Repeated Execution of IStartable.Start() #729

@tobyapi

Description

@tobyapi

再現環境:

  • Unity 2022.3.43f1
  • VContainer v1.16.6

以下のコードを適当な GameObject にアタッチして実行すると、IStartable.Start() が何度も実行されていました。この挙動が想定通りかお伺いしたいです。

using System;
using VContainer;
using VContainer.Unity;

public class TestLifetimeScope : LifetimeScope
{
    protected override void Configure(IContainerBuilder builder)
    {
        builder.Register<TestClass>(Lifetime.Singleton).AsImplementedInterfaces();
    }
}

public class TestClass : IStartable
{
    void IStartable.Start()
    {
        throw new Exception();
    }
}

13


When the following code is attached to an appropriate GameObject and executed, IStartable.Start() was being called repeatedly. I would like to ask if this behavior is as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions