custom ValueType within another ValueType

So I created two classes that inherit ValueType and it works great.

Like this :

public class Tile extends System.ValueType{

var num			:int;
var x			:int;
var y			:int;
var z			:int;


Is it possible to use that class in another class at initialization?

Like this :

public class Grid extends System.ValueType{

var tileCount	:int;
var tiles		:Tile[];


Doesn’t seem to work at all I can’t assign anything to var tiles, it always says its not set to an instance of an object and null, other variables are fine.

UPDATE : Seems to have a problem with it being an array of objects. If I make it a single object it works fine.

Try to mark your Tile class


Edit: Ah no. Sorry read your question wrong. The first solution enables you to edit your array in the inspector. Regarding your real problem:

You don’t initialize the array. Try this in your Grid before you use the array.

tiles = new Tile[ SizeOfTheArrayYouWant ];