public void OpenSellerEquipmentActions(float buyValue) { int playerGoldAmount = IntersceneManager.intersceneManager.GetPlayerDatas.GetPlayerGoldAmount; equipButton.gameObject.SetActive(false); upgradeButton.gameObject.SetActive(false); sellButton.gameObject.SetActive(false); buyButton.gameObject.SetActive(true); buyValueText.text = buyValue.ToString(); bool playerFull = false; if (MapManager.mapManager != null && IntersceneManager.intersceneManager != null) { playerFull = MapManager.mapManager.DocksManager.InvtrManager.GetPlayerInventoryEquipments.Count >= IntersceneManager.intersceneManager.GetPlayerDatas.GetPlayerInventoryCapacity; } if (playerGoldAmount >= buyValue && !playerFull) { buyButton.SetButtonInteractable(true); buyValueText.color = canColor; buyValueImage.color = canImageColor; } else { buyButton.SetButtonInteractable(false); buyValueText.color = cantColor; buyValueImage.color = cantImageColor; if (playerFull) { buyValueText.text = "Full"; } } }
public void OpenPlayerInventoryEquipmentActions(bool upgradable, float upgradeValue, float sellValue) { int playerGoldAmount = IntersceneManager.intersceneManager.GetPlayerDatas.GetPlayerGoldAmount; equipButton.gameObject.SetActive(true); upgradeButton.gameObject.SetActive(true); sellButton.gameObject.SetActive(true); buyButton.gameObject.SetActive(false); if (!upgradable) { upgradeButton.SetButtonInteractable(false); upgradeValueText.gameObject.SetActive(false); upgradeValueImage.gameObject.SetActive(false); nonUpgradeText.gameObject.SetActive(true); //upgradeValueText.text = "Max Level"; nonUpgradeText.color = cantColor; } else { upgradeValueText.gameObject.SetActive(true); upgradeValueImage.gameObject.SetActive(true); nonUpgradeText.gameObject.SetActive(false); upgradeValueText.text = upgradeValue.ToString(); if (playerGoldAmount >= upgradeValue) { upgradeButton.SetButtonInteractable(true); upgradeValueText.color = canColor; upgradeValueImage.color = canImageColor; } else { upgradeButton.SetButtonInteractable(false); upgradeValueText.color = cantColor; upgradeValueImage.color = cantImageColor; } } sellValueText.text = sellValue.ToString(); }