public void ActiveteBuilding(Button pressedBtn) { if (pressedBtn.name == "BuildButton") { if (buildopen) { //bm.DeactivateBuildingmode(); BotFactory.gameObject.SetActive(false); TankFactory.gameObject.SetActive(false); Metal.gameObject.SetActive(false); Energy.gameObject.SetActive(false); pressedBtn.image.color = Color.white; buildopen = false; } else { //bm.ActivateBuildingmode(); BotFactory.gameObject.SetActive(true); TankFactory.gameObject.SetActive(true); Metal.gameObject.SetActive(true); Energy.gameObject.SetActive(true); pressedBtn.image.color = new Color(255, 0, 255); buildopen = true; } } else { switch (pressedBtn.name) { case "BotFactory": bm.SelectBuilding(0); break; case "TankFactory": bm.SelectBuilding(1); break; case "Metal": bm.SelectBuilding(2); break; case "Energy": bm.SelectBuilding(3); break; } pressedBtn.image.color = new Color(155, 120, 255); bm.ActivateBuildingmode(); } }
public void ActiveteBuilding(Button pressedBtn) { if (pressedBtn.name == "BuildButton") { if (buildopen) { //bm.DeactivateBuildingmode(); cube.gameObject.SetActive(false); cylinder.gameObject.SetActive(false); pressedBtn.image.color = Color.white; buildopen = false; } else { //bm.ActivateBuildingmode(); cube.gameObject.SetActive(true); cylinder.gameObject.SetActive(true); pressedBtn.image.color = new Color(255, 0, 255); buildopen = true; } } else { switch (pressedBtn.name) { case "CubeButton": bm.SelectBuilding(0); break; case "CylinderButton": bm.SelectBuilding(1); break; } pressedBtn.image.color = new Color(155, 120, 255); bm.ActivateBuildingmode(); } }