So basically I want to know if I can use a class as an array of variables, now I don’t need to add variables to the class just get the total number of variables in it, and then call each variable by that number.
And if not could I make the variables in a class part of a function and then do it that way.
Like here
public class SingleCharacterScript extends MonoBehaviour
{
public class Stuff
{
public var bullets : int;
public var grenades : int;
public var rockets : int;
public function Stuff(bul : int, gre : int, roc : int)
{
bullets = bul;
grenades = gre;
rockets = roc;
}
}
then just do eather
class.Stuff.length
or
Stuff.length
??? I have been searching the api and can’t find anything.