public void OnClickCraft() { PlayerCharacter player = PlayerCharacter.Get(); if (player.CanCraft(data)) { ItemData item = data.GetItem(); ConstructionData construct = data.GetConstruction(); PlantData plant = data.GetPlant(); if (item != null) { player.CraftItem(item); } if (construct != null) { player.SelectCraftConstruction(construct); } if (plant != null) { player.CraftPlant(plant); } craft_btn.interactable = false; Hide(); } }
public ConstructionData GetConstruction() { if (item != null) { return(item.GetConstruction()); } return(null); }