How to catch clicks past an object?
I'm creating a game in the TD genre. When the user clicks on a tower, it shows its range, but if the user selects another tower, then the other tower will also have a range. 2 will be active at once. And I need that if 1 tower is selected, then the other is automatically disabled.How to do it?
I turn the tower on and off like this
public void OnMouseDown()
{
Debug.Log("1");
if(CyrcleUse.activeSelf == false)
{
CanvasTower.SetActive(true);
CyrcleUse.SetActive(true);
}
else if (CyrcleUse.activeSelf == true)
{
CanvasTower.SetActive(false);
CyrcleUse.SetActive(false);
}
}
192557-12321.png
(47.3 kB)
Comment