File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace TNRD
99 /// </summary>
1010 /// <typeparam name="TInterface">The type of the interface you want to serialize</typeparam>
1111 [ Serializable ]
12- public class SerializableInterface < TInterface > : ISerializableInterface
12+ public class SerializableInterface < TInterface > : ISerializableInterface where TInterface : class
1313 {
1414 [ HideInInspector , SerializeField ] private ReferenceMode mode = ReferenceMode . Unity ;
1515 [ HideInInspector , SerializeField ] private UnityEngine . Object unityReference ;
@@ -21,8 +21,8 @@ public TInterface Value
2121 {
2222 return mode switch
2323 {
24- ReferenceMode . Raw => ( TInterface ) rawReference ,
25- ReferenceMode . Unity => ( TInterface ) ( object ) unityReference ,
24+ ReferenceMode . Raw => rawReference as TInterface ,
25+ ReferenceMode . Unity => ( object ) unityReference as TInterface ,
2626 _ => throw new ArgumentOutOfRangeException ( )
2727 } ;
2828 }
You can’t perform that action at this time.
0 commit comments