//To be called if Power Plant Button is pressed //All panels will closed //Power Plant building will be instantiated //Set dragging true public void PowerPlantButton() { ProtectorPanel.SetActive(true);//To avoid clicking another button while in this condition BarracksPanel.SetActive(false); PowerPlantPanel.SetActive(false); Building = Instantiate(PowerPlantPrefab, mousePos, Quaternion.identity); properBuildingScript = Building.GetComponent <ProperBuildingScript>(); dragging = true; }
//To be called if Power Plant Button is pressed //All panels will closed //Power Plant building will be instantiated //Set dragging true public void PowerPlantButton() { GameView.ProtectorPanel.SetActive(true);//To avoid clicking another button while in this condition GameView.BarracksPanel.SetActive(false); GameView.PowerPlantPanel.SetActive(false); Cursor.visible = false; var building = powerPlantFactory.GetNewInstance();//Building by pp factory Building = building.gameObject; properBuildingScript = Building.GetComponent <ProperBuildingScript>(); dragging = true; }