// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { mouseSelects = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), new Vector3(0, 0, 1)); Debug.Log(string.Format("Select")); if (mouseSelects != null) { foreach (RaycastHit2D select in mouseSelects) { if (select.collider.CompareTag("Tower")) { CupcakeTower selectedTower = select.transform.GetComponent <CupcakeTower>(); selectedTower.outlineActive(true); TradeCupcakeTowers.setSelectTower(selectedTower); TowerInfo.UpdateInfo(); } } } } }