private void SpawnPadding(int tileSetId, TilePadding padding) { Sprite[] sprites = TerrainTileSet.LoadedTileSets[tileSetId].GetPaddingSprites(padding); foreach (var sprite in sprites) { GameObject paddingObject = new GameObject(); paddingObject.transform.SetParent(_paddingAnchor.transform); paddingObject.AddComponent <SpriteRenderer>().sprite = sprite; paddingObject.transform.position = transform.position - new Vector3(0f, 0f, TerrainTileSet.LoadedTileSets[tileSetId].Precedence); _paddingObjects.Add(paddingObject); } }
public Sprite[] GetPaddingSprites(TilePadding paddingInformation) { paddingInformation.ApplyFilter(); List <Sprite> sprites = new List <Sprite>(); int edges = paddingInformation.EdgeInformation(); if (edges != -1) { sprites.Add(Tiles[edges]); } int corners = paddingInformation.CornerInformation(); if (corners != -1) { sprites.Add(Tiles[corners]); } return(sprites.ToArray()); }