Collectables online, Main hall Join

This commit is contained in:
Sewmina
2022-04-20 03:12:23 +05:30
parent 56a926ec34
commit 3a6cda1a22
76 changed files with 3798 additions and 1632 deletions

View File

@@ -8,6 +8,9 @@ public class SelectedItemMenu : MonoBehaviour
public Text nameTxt;
public Button upgradeMenuBtn;
public Button infoBtn;
public CollectBtn collectBtn;
public Button joinHallBtn;
public Button repairRocketsBtn;
[Header("info menu")]
public GameObject infoMenu;
@@ -18,12 +21,17 @@ public class SelectedItemMenu : MonoBehaviour
public Transform upgrade_statParent;
public Button upgradeBtn;
[Header("Special buildings")]
public BuildingData mainHall;
public BuildingData rocketRepair;
void Start()
{
Selector.OnSelectedChanged.AddListener(OnSelectionChanged);
upgradeMenuBtn.onClick.AddListener(OnUpgradeMenuClicked);
infoBtn.onClick.AddListener(OnInfoClicked);
upgradeBtn.onClick.AddListener(OnUpgrade);
collectBtn.btn.onClick.AddListener(OnCollect);
}
void OnSelectionChanged()
@@ -39,11 +47,26 @@ public class SelectedItemMenu : MonoBehaviour
{
upgradeMenuBtn.gameObject.SetActive(true);
}
if(Selector.selectedData.collectable){
collectBtn.gameObject.SetActive(true);
Debug.Log("Last collected : " +Selector.selectedBuilding.lastCollected );
collectBtn.Set(Selector.selectedBuilding.lastCollected,Selector.selectedData.productinoRates[Selector.selectedBuilding.curLevel]);
}else{
collectBtn.gameObject.SetActive(false);
}
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);
}
upgradeMenu.SetActive(false);
@@ -102,4 +125,9 @@ public class SelectedItemMenu : MonoBehaviour
infoMenu.SetActive(true);
descriptionTxt.text = Selector.selectedBuilding.buildingData.description;
}
void OnCollect(){
Debug.Log("Collecting from : " + Selector.selectedData.buildingName);
}
}