Oops sorry missed this one Yes right TS
Oops sorry, missed this one. Yes, right. TS types are all stripped when transpiled into js. So calling C# generic functions from TS won't work directly.
2 Replies
Another approach is to create a helper function/extension and use reflection.
Basically, for your example, you can make a
Register
function that takes in a Type type
parameter.
Beside being more flexible, this also makes the TS calling code a little easier to write:
(You can directly feed MeshRenderer
into the GetComponent()
call)Unknown User•3y ago
Message Not Public
Sign In & Join Server To View