void FarmObjectBuy() { FarmObject productFarmObject = product.GetComponent <FarmObject>(); FarmObject shopFarmObject; shopFarmObject = gameObject.GetComponent <FarmObject>(); Debug.Log(shopFarmObject.shopCost); Debug.Log(DataManager._instance.playerData.money); if (shopFarmObject.shopCost < DataManager._instance.playerData.money) { Debug.Log(gameObject.name); productImage = GameObject.Find("arrangeImage"); product = gameObject.GetComponent <ShopButtonManager>().product; ShopButtonManager productImgSBM = productImage.GetComponent <ShopButtonManager>(); productImgSBM.product = product; image = productImage.GetComponent <Image>(); image.sprite = shopFarmObject.farmObjectSprite; FarmObject productImageFarmObject = productImage.GetComponent <FarmObject>(); productImageFarmObject.farmObjectNumber = shopFarmObject.farmObjectNumber; productImageFarmObject.shopCost = shopFarmObject.shopCost; Drag PIDrag = productImage.GetComponent <Drag>(); PIDrag.PItransformMid(); OKButton.gameObject.SetActive(true); cancelButton.gameObject.SetActive(true); shopList.SetActive(false); shopCloseButton.SetActive(false); } }
public void FarmObjectArrange() { inventory.SetActive(false); saleButton.SetActive(false); arrangeButton.SetActive(false); putButton.SetActive(true); cancelButton.SetActive(true); Spawner._instance.farmObjects[InputManager.farmObjectIndex].isField = true; Drag arrangeImageDrag = arrangeImage.GetComponent <Drag>(); arrangeImageDrag.PItransformMid(); Image spriteRenderer = arrangeImage.GetComponent <Image>(); spriteRenderer.sprite = invenArrangeIcons[InputManager.farmObjectNumber]; }