Exemplo n.º 1
0
    // 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();
    }
Exemplo n.º 2
0
 public void OpenTargetingMenu()
 {
     targetingRadialMenu.ActivateRadialMenu();
     DeactivateRadialMenu();
 }
Exemplo n.º 3
0
 void OpenLevelUpMenu()
 {
     levelUpRadialMenu.ActivateRadialMenu();
     DeactivateRadialMenu();
 }