diff --git a/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs b/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs index aaa8ea83..08c28d0b 100644 --- a/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs +++ b/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs @@ -57,17 +57,13 @@ public static void UseEntryPoints( configuration(entryPoints); } - public static void UseComponents( - this IContainerBuilder builder, - Action configuration) + public static void UseComponents(this IContainerBuilder builder, Action configuration) { var components = new ComponentsBuilder(builder); configuration(components); } - public static RegistrationBuilder RegisterEntryPoint( - this IContainerBuilder builder, - Lifetime lifetime) + public static RegistrationBuilder RegisterEntryPoint(this IContainerBuilder builder, Lifetime lifetime) { var registrationBuilder = builder.Register(lifetime); if (typeof(T).IsSubclassOf(typeof(MonoBehaviour))) @@ -77,27 +73,21 @@ public static RegistrationBuilder RegisterEntryPoint( return registrationBuilder.AsImplementedInterfaces(); } - public static RegistrationBuilder RegisterComponent( - this IContainerBuilder builder, - MonoBehaviour component) + public static RegistrationBuilder RegisterComponent(this IContainerBuilder builder, MonoBehaviour component) { var registrationBuilder = builder.RegisterInstance(component).As(typeof(MonoBehaviour), component.GetType()); builder.RegisterBuildCallback(container => container.Inject(component)); return registrationBuilder; } - public static RegistrationBuilder RegisterComponent( - this IContainerBuilder builder, - TInterface component) + public static RegistrationBuilder RegisterComponent(this IContainerBuilder builder, TInterface component) { var registrationBuilder = builder.RegisterInstance(component).As(typeof(MonoBehaviour), typeof(TInterface)); builder.RegisterBuildCallback(container => container.Inject(component)); return registrationBuilder; } - public static RegistrationBuilder RegisterComponentInHierarchy( - this IContainerBuilder builder - ) where T : MonoBehaviour + public static RegistrationBuilder RegisterComponentInHierarchy(this IContainerBuilder builder) { var lifetimeScope = (LifetimeScope)builder.ApplicationOrigin; var scene = lifetimeScope.gameObject.scene;