diff --git a/VContainer/Assets/VContainer/Runtime/Unity/LifetimeScope.cs b/VContainer/Assets/VContainer/Runtime/Unity/LifetimeScope.cs index 88c7a82d..a97b4705 100644 --- a/VContainer/Assets/VContainer/Runtime/Unity/LifetimeScope.cs +++ b/VContainer/Assets/VContainer/Runtime/Unity/LifetimeScope.cs @@ -171,7 +171,14 @@ public void Dispose() DisposeCore(); if (this != null) { - Destroy(gameObject); + if (Application.isPlaying) + { + Destroy(gameObject); + } + else + { + DestroyImmediate(gameObject); + } } }