14 Replies
You cannot do that at compile time
You can either do that with Reflection at runtime or change the approach a little and use code generators
yeah i want a simular resoultuion
You either need to make your context generic, or use runtime reflection
i think i must store the type in a seperate variable in the SyncedVariable
Just FYI, C# is not Typescript and you would benefit from not treating it as such
Chances are it's an XY issue that can be solved with generics
if you cant have the entire context generic, you have to at some point do something like this:
have anyone a example?
We don't really know the wider context of what you want to do, so hard to give an example
very ugly
would be ideal
Or make it a generic class or w/e
i approve of trying to get the entire context generic
generally reflection is the last option u want to use
ye
if you explain more in what context you want to use it, we could maybe give you more tips