So, as per the title, how do I do this?
I have a 2D array which is created like this:
private var allShips:Ship[,];
And when I try to return a single dimension of the array, like so (where ShipType is an enum that represents an int):
function getAllShips(shipType:ShipType) : Ship[] {
return allShips[shipType];
}
I get the error
BCE0022: Cannot convert ‘Ship’ to ‘Ship’.
When I try to just return allShips[0] I still get the same problem. Is what I’m trying to do possible in unityscript? I just want to return an array reference for iteration.
Thanks in advance