- Home /
What are GameTiles?
I came across this line of code here:
public static GameTile[,] Tiles = new GameTile[BoardSize, BoardSize];
And was curious what it was referencing. I can't find anything for Unity (or C#) on Google related to GameTile. I've seen multi-dimensional arrays initialized before like such:
private static Transform[,] grid = new Transform[width, height];
or
string[,] array2Db = new string[3, 2] { { "one", "two" }, { "three", "four" }, { "five", "six" } };
where I had presumed the word before [,] was the object or class that made up the array, but in the case of GameTile, I can't find references to it anywhere. Thank you advance for your help and elaboration.
Answer by ShadyProductions · Mar 17, 2020 at 10:53 PM
It is probably a class the user made himself (not part of unity) like:
public class GameTile
{
}
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/classes
In the "Converting from board to world space" section of the link you refer to, you can see him building the GameTile class himself.
Thank you! Went through the source code and found the GameTile class, as you suggested would exist.
Your answer
Follow this Question
Related Questions
SAVE OBJECTS IN ARRAY 1 Answer
Warning on creating an array of class objects 3 Answers
array of objects 1 Answer
adding classes to arrays 2 Answers