void OnGUI() { if (!debug) { return; } for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { TileTypes tileType = GetTileType(x, y); GUI.Label(new Rect(new Vector2(x, height - 1 - y) * 64, Vector2.one * 64), tileType.ToString()); } } }
// =============================================================== // Tiles // =============================================================== public Tile CreateTile(int x, int y, TileTypes type, Color color) { Transform parent = container.Find("Tiles/" + type.ToString()); GameObject obj = (GameObject)Instantiate(prefabs.tiles[type]); obj.transform.SetParent(parent, false); obj.name = type.ToString(); //"Tile " + x + " " + y; Tile tile = obj.GetComponent<Tile>(); tile.Init(this, type, x, y, color); SetTile(x, y, tile); return tile; }
public Sprite TileSpriteChange(TileTypes _tiletype) { return(Resources.Load <Sprite>(_tiletype.ToString())); }