// Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1")) { //we raycast to where we click Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (activeTower == null) { if (Physics.Raycast(ray, out hit, Mathf.Infinity)) { if (hit.collider.gameObject.tag == "Tower") { //if we click on a tower, we change that to be the active tower //StartCoroutine(SlowlyChangeActiveTower()); activeTower = hit.collider.gameObject; if (activeTower.GetComponentInChildren <TowerShootsScript>().level == 0) { radialMenu.levelUpRadialMenu.ActivateRadialMenu(); } else { radialMenu.ActivateRadialMenu(); } } //else //{ // //if we don't hit a tower, we just close the menu // StartCoroutine(SlowlyCloseRadialMenu()); //} } } } GameOver(); }
public void OpenTargetingMenu() { targetingRadialMenu.ActivateRadialMenu(); DeactivateRadialMenu(); }
void OpenLevelUpMenu() { levelUpRadialMenu.ActivateRadialMenu(); DeactivateRadialMenu(); }