3
I’m doing some tests on Unity so I can practice programming. I’m new and this question can be kind of stupid. I want to know if this is possible:
I created the following abstract class:
public abstract class Variable<T> : ScriptableObject {}
And I want to use this class as a variable that will accept children of that class:
private Variable<Int> variable;
But I want the variable to accept children of any kind and not just the declared something like:
private Variable variable;
That’s possible?
It would not be the case to use
var
?– Costamilam
Unity only accepts c# 2.0 cannot use var :/
– Valter Luiz
@Valterluiz I suggest you read here and also watch the video about
ScriptableObject
.– gato
@Valterluiz Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already done so. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site.
– Maniero