private void Start() { FieldType = FieldAttribute.Type.Wasteland; PlantType = PlantTypeAttribute.PlantType.None; // 最初は非表示に timeSlider.gameObject.SetActive(false); image.enabled = false; }
private IEnumerator SeedTimer() { image.sprite = Resources.Load <Sprite>("Images/Plants/SeedImg"); PlantType = PlantTypeAttribute.PlantType.Seed; // ログ出力 Debug.Log("植えられました"); // 10秒待つ yield return(new WaitForSeconds(10.0f)); image.sprite = Resources.Load <Sprite>("Images/Plants/komugiImg"); PlantType = PlantTypeAttribute.PlantType.Wheat; Debug.Log("育ちました"); }
public int Harvest() { if (PlantType == PlantTypeAttribute.PlantType.None || PlantType == PlantTypeAttribute.PlantType.Seed) { return(0); } PlantType = PlantTypeAttribute.PlantType.None; FieldType = FieldAttribute.Type.Farmland; image.enabled = false; var count = Random.Range(1, 3); return(count); }