- Home /
Changing the class of a variable
Hi, I've got an instance where I need to change the class of a variable so that it could be one of two classes. How would I do this?
var aVar;
var aNum:int;
if(aNumb == 1)
{
// aVar gets class 'fish'
}
else if(aNumb == 2)
{
// aVar gets class 'bird'
}
Comment
Your answer
Follow this Question
Related Questions
Accessing variables from seperate scripts 1 Answer
Missing Documentation on accessing Variables 1 Answer
Can I choose what to pass into .getcomponent<{VARIABLE}>(); 1 Answer
Class functions don't seem to be updating class variables 1 Answer
How do you assign the class of one varriable to another? 2 Answers