I want to create a method which will take ANY variable type as an argument. And by any I mean user-defined types, so it could be a very flexible method that can be reused anytime. Kind of:
static internal class ArrayFill {
public int Fill (**PARSED_STRING_TYPE** arr) {
*whatever code goes in here*
}
}
So the first idea I came up with is parsing a string, since in my last job I worked with a language that would let me to parse a string during runtime, but from my research it doesn't seem that exists here. So I thought maybe it could be done in some way prior to compilation, in Editor scripting somehow?
I thought a workaround could be overloading the method, but I would like to avoid overloading for each type.
↧