private void Start() { rabish = new CropProperty(); rabish.CropID = 1; rabish.CropName = "萝卜"; rabish.CropCount = 10; }
public void CheckCrops(int level, CropProperty cp) { if (level == cropCount) { return; } for (int i = 0; i < content.childCount; i++) { Destroy(content.GetChild(i).gameObject); } for (int i = 0; i < level; i++) { GameObject go = Instantiate(CropPFB, content); go.GetComponent <CropSlot>().SetCropSlot(cp); } }
public void SetCropSlot(CropProperty cp) { CropName.text = cp.CropName; CropCount.text = string.Format("{0}个/天", cp.CropCount.ToString()); //image; }