Ive been having issues with this for quite a bit now and cant find anything on the wiki / answers about this . Basically, I have a Block class for my voxel engine, each voxel has an individual instance of the Block class, this class basically stores the main aspects of the block, the ID , the texture data and stuff, but I wanted to implement a feature that allowed me to have custom classes for each block so that I can make them store custom variables and also make them have features individually.
I am having trouble thinking of a way to fill an array of 32x32x32 values with different block classes, I thought of having all the classes as blocks and then having a variable hold the secondary " feature " class of the block , this is how I do it so far :
// I was not sure how to store it so I did this :
public object customClass;
// I then had a switch to manage which class to instance
customClass= new BlockEngine(this,1.0f);
I just dont know how I would access the class from another script because I cannot do :
because it does not give me the option to access it through that. If anybody could show me a way to store a kind of changeable class type variable, I would be very grateful!