I am writing an semi generic wrapper for unity's new input system.
using UnityEngine.InputSystem; public class NewInputSystemWrapper { public void test<T>() where T : notnull { InputAction action = Whatever(); _ = action.ReadValue<T>(); } }
I am getting the following error message. But why? I have declared that T is notnull. (I just want to pass through T to the ReadValue method.)
CodePudding user response:
Just follow the constraint of ReadValue method.
public void test<T>() where T : struct