SkinShop done and building menus integrated
This commit is contained in:
@@ -9,16 +9,20 @@ public class SelectedItemMenu : MonoBehaviour
|
||||
public Button upgradeMenuBtn;
|
||||
public Button infoBtn;
|
||||
public CollectBtn collectBtn;
|
||||
public Button joinHallBtn;
|
||||
public Button repairRocketsBtn;
|
||||
// public Button joinHallBtn;
|
||||
// public Button repairRocketsBtn;
|
||||
|
||||
[Header("info menu")]
|
||||
public GameObject infoMenu;
|
||||
public GameObject[] tierIndicators;
|
||||
public TMP_Text buildingName;
|
||||
public TMP_Text descriptionTxt;
|
||||
|
||||
[Header("upgrade menu")]
|
||||
public GameObject upgradeMenu;
|
||||
public Transform upgrade_statParent;
|
||||
public GameObject[] upgrade_tierIndicators;
|
||||
public TMP_Text upgrade_buildingName;
|
||||
public Button upgradeBtn;
|
||||
|
||||
[Header("Special buildings")]
|
||||
@@ -57,16 +61,16 @@ public class SelectedItemMenu : MonoBehaviour
|
||||
collectBtn.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
joinHallBtn.gameObject.SetActive((Selector.selectedData == mainHall));
|
||||
repairRocketsBtn.gameObject.SetActive((Selector.selectedData == rocketRepair));
|
||||
// joinHallBtn.gameObject.SetActive((Selector.selectedData == mainHall));
|
||||
// repairRocketsBtn.gameObject.SetActive((Selector.selectedData == rocketRepair));
|
||||
}
|
||||
else
|
||||
{
|
||||
upgradeMenuBtn.gameObject.SetActive(false);
|
||||
infoBtn.gameObject.SetActive(false);
|
||||
collectBtn.gameObject.SetActive(false);
|
||||
joinHallBtn.gameObject.SetActive(false);
|
||||
repairRocketsBtn.gameObject.SetActive(false);
|
||||
// joinHallBtn.gameObject.SetActive(false);
|
||||
// repairRocketsBtn.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
upgradeMenu.SetActive(false);
|
||||
@@ -78,7 +82,10 @@ public class SelectedItemMenu : MonoBehaviour
|
||||
// Debug.Log("Opening Upgrade Menu for : " + Selector.selectedBuilding.buildingData.name);
|
||||
|
||||
upgradeMenu.SetActive(true);
|
||||
|
||||
upgrade_buildingName.text = Selector.selectedBuilding.buildingData.buildingName;
|
||||
for(int i=0; i < upgrade_tierIndicators.Length;i++){
|
||||
upgrade_tierIndicators[i].SetActive( Selector.selectedBuilding.curLevel == i);
|
||||
}
|
||||
if (Selector.selectedBuilding.curLevel < Selector.selectedData.levels.Count - 1)
|
||||
{
|
||||
upgradeBtn.interactable = (Selector.selectedData.levels[Selector.selectedBuilding.curLevel + 1].price < DBmanager.Coins);
|
||||
@@ -102,10 +109,11 @@ public class SelectedItemMenu : MonoBehaviour
|
||||
{
|
||||
upgrade_statParent.GetChild(i).GetChild(0).GetComponent<TMP_Text>().text = stats[i].name;
|
||||
upgrade_statParent.GetChild(i).GetChild(1).GetComponent<TMP_Text>().text = stats[i].value;
|
||||
upgrade_statParent.GetChild(i).GetChild(2).GetComponent<Image>().sprite = stats[i].image;
|
||||
}
|
||||
}
|
||||
|
||||
if (upgrade_statParent.childCount > stats.Count)
|
||||
if (upgrade_statParent.childCount < stats.Count)
|
||||
{
|
||||
Debug.LogError("Please add another slot for stats in upgrade menu.\nSlots not enough for " + Selector.selectedBuilding.buildingData.name + " , " + upgrade_statParent.childCount + " slots for " + stats.Count + " stats");
|
||||
}
|
||||
@@ -123,6 +131,10 @@ public class SelectedItemMenu : MonoBehaviour
|
||||
Debug.Log("Opening Info Menu for : " + Selector.selectedBuilding.buildingData.name);
|
||||
|
||||
infoMenu.SetActive(true);
|
||||
buildingName.text = Selector.selectedBuilding.buildingData.buildingName;
|
||||
for(int i=0; i < tierIndicators.Length;i++){
|
||||
tierIndicators[i].SetActive( Selector.selectedBuilding.curLevel == i);
|
||||
}
|
||||
descriptionTxt.text = Selector.selectedBuilding.buildingData.description;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user