private void ReplaceTile(Vector3 position, QuadTileData brush, float height) { if (GetTiles().ContainsKey(position.ToVector2IntXZ())) { GetTiles()[position.ToVector2IntXZ()].Init(brush, height); } }
public void AddTile(Vector3 position, QuadTileData brush, float height) { if (GetTiles().ContainsKey(position.ToVector2IntXZ())) { ReplaceTile(position, brush, height); return; } QuadTile newTile = Instantiate(tilePrefab, position, tilePrefab.transform.rotation, transform); newTile.Init(brush, height); newTile.gameObject.SetLayerRecursively(LayerMask.NameToLayer("Ignore Editor")); GetTiles().Add(position.ToVector2IntXZ(), newTile); }
public void UpdateSelectionMaterials(QuadTileData data, Color color) { top.sharedMaterial.SetTexture("_BaseMap", data.top.GetTexture("_BaseMap")); top.sharedMaterial.SetColor("_BaseColor", color); sideLayers.ForEach(x => x.SetSelectionMaterial(data.sides, color)); }
private void UpdateMaterials(QuadTileData data) { tileData = data; top.sharedMaterial = data.top; sideLayers.ForEach(x => x.SetMaterials(data.sides)); }
public void Init(QuadTileData brush, float height) { tileData = brush; this.height = height; RefreshTile(); }