From a96a6c6534bb04e9597b307433799c00512b9336 Mon Sep 17 00:00:00 2001 From: Aleksei Melkor <30626539+amelkor@users.noreply.github.com> Date: Sun, 7 May 2023 13:39:38 +0700 Subject: [PATCH] fix AddScriptableObjectSingleton T type constraint --- Runtime/Abstractions/IUnityObjectServiceCollectionBuilder.cs | 2 +- Runtime/Internals/UnityObjectServiceCollectionBuilder.cs | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Runtime/Abstractions/IUnityObjectServiceCollectionBuilder.cs b/Runtime/Abstractions/IUnityObjectServiceCollectionBuilder.cs index e532280..590dbce 100644 --- a/Runtime/Abstractions/IUnityObjectServiceCollectionBuilder.cs +++ b/Runtime/Abstractions/IUnityObjectServiceCollectionBuilder.cs @@ -21,7 +21,7 @@ public interface IUnityObjectServiceCollectionBuilder IUnityObjectServiceCollectionBuilder AddScriptableObjectSingleton(ScriptableObject scriptableObject, Type type); IUnityObjectServiceCollectionBuilder AddScriptableObjectSingleton(T scriptableObject) where T : ScriptableObject; - IUnityObjectServiceCollectionBuilder AddScriptableObjectSingleton(TImpl scriptableObject) where T : ScriptableObject where TImpl : ScriptableObject, T; + IUnityObjectServiceCollectionBuilder AddScriptableObjectSingleton(TImpl scriptableObject) where T : class where TImpl : ScriptableObject, T; IUnityObjectServiceCollectionBuilder AddMonoBehaviourPrefabSingleton(string resourcesPath) where T : MonoBehaviour; IUnityObjectServiceCollectionBuilder AddMonoBehaviourPrefabTransient(string resourcesPath) where T : MonoBehaviour; diff --git a/Runtime/Internals/UnityObjectServiceCollectionBuilder.cs b/Runtime/Internals/UnityObjectServiceCollectionBuilder.cs index df2a86d..4b904d4 100644 --- a/Runtime/Internals/UnityObjectServiceCollectionBuilder.cs +++ b/Runtime/Internals/UnityObjectServiceCollectionBuilder.cs @@ -232,7 +232,7 @@ public IUnityObjectServiceCollectionBuilder AddScriptableObjectSingleton(T sc return this; } - public IUnityObjectServiceCollectionBuilder AddScriptableObjectSingleton(TImpl scriptableObject) where T : ScriptableObject where TImpl : ScriptableObject, T + public IUnityObjectServiceCollectionBuilder AddScriptableObjectSingleton(TImpl scriptableObject) where T : class where TImpl : ScriptableObject, T { _hostBuilder.ConfigureServices(services => { diff --git a/package.json b/package.json index 8b8f968..b657cb0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "Microsoft.Extensions.Hosting adopted for Unity", "unity": "2021.1", "release": "0f1", - "version": "2.1.0-preview.4", + "version": "2.1.0-preview.5", "keywords": [ "unity", "integration",