using UnityEngine; namespace Tiles { public class GrassTile : BaseTile { public GrassTile(GameObject gameObject) : base("Assets/Farming Asset Pack/Split Assets/farming_tileset_000.png", gameObject) { } /// /// to be invoked when the Tile is clicked, handles the actions following on the click /// /// the UsableItem that the Tile was clicked on with /// a subclass of BaseTile if the Tile has to change, null if it stays the same type public override BaseTile Clicked(UsableItem usable) { BaseTile rv = null; ItemContainer ic = ItemContainer.Instance; if (usable != null) { base.Clicked(usable); if (usable.Id == ic.GetItemIdByName("Hoe")) { rv = new FarmlandTile(_gameObject); } else if (usable.Id == ic.GetItemIdByName("Shovel")) { rv = new WaterTile(_gameObject); } } return rv; } } }