public static void DrawTilemap(abstract_tilemap tilemap) { if (!_instance) { return; } if (_instance._tilemap != null) { foreach (TileBehaviour tile in _instance._tilemap) { Destroy(tile.gameObject); // TODO } } _instance._tilemap = new TileBehaviour[tilemap.scale.x, tilemap.scale.y]; for (int y = 0; y < tilemap.scale.y; y++) { for (int x = 0; x < tilemap.scale.x; x++) { base_tile tile = tilemap.data[y * tilemap.scale.x + x]; Vector3 position = tilemap.GetPosition(x, y, tile); // TODO TileBehaviour tileBehaviour = Instantiate(_instance.TilePrefab, position, Quaternion.identity, _instance.ParentTransform); tileBehaviour.DrawTile(tile); _instance._tilemap[x, y] = tileBehaviour; } } }
public void DrawTile(base_tile tile) { }
public virtual Vector3 GetPosition(int x, int y, base_tile tile) { throw new NotImplementedException("Implement me"); }
public override Vector3 GetPosition(int x, int y, base_tile tile) { return(new Vector3(x, tile.height * 2, y)); }
public override Vector3 GetPosition(int x, int y, base_tile tile) { throw new NotImplementedException("Release me"); }