Scriptable Objects + Upgrade Menu
This commit is contained in:
@@ -18,7 +18,7 @@ public class WorldItemSelector : MonoBehaviour
|
||||
if(Physics.Raycast(ray,out hit, Mathf.Infinity, layerMask)){
|
||||
Building selectedB = hit.collider.GetComponent<Building>();
|
||||
if(selectedB!=null){
|
||||
Debug.Log("Selected building : " + selectedB.buildingName);
|
||||
Debug.Log("Selected building : " + selectedB.buildingData.buildingName);
|
||||
Selector.selectBuilding(selectedB);
|
||||
}else{
|
||||
Debug.Log("No target here, Unselecting");
|
||||
@@ -32,8 +32,20 @@ public class WorldItemSelector : MonoBehaviour
|
||||
public void RefreshUI(){
|
||||
selectedItemUI.gameObject.SetActive(Selector.selectedBuilding !=null);
|
||||
if(Selector.selectedBuilding!=null){
|
||||
selectedItemUI.GetChild(0).GetComponent<Text>().text = Selector.selectedBuilding.buildingName;
|
||||
selectedItemUI.GetChild(0).GetComponent<Text>().text = Selector.selectedBuilding.buildingData.buildingName;
|
||||
}
|
||||
|
||||
// switch (Selector.selectedBuilding.buildingData.buildingName)
|
||||
// {
|
||||
// case "Research Facility":
|
||||
// Debug.Log("research facility menu");
|
||||
// break;
|
||||
|
||||
// case "Green House":
|
||||
// Debug.Log("green house menu");
|
||||
// break;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user