void OnMouseUp() { if (ButtonScript.selectedTower != null) { Debug.Log("Ground clicked"); selectManager.DeselectAll(); } }
void OnMouseUp() { buildCanvas.SetActive(true); buildCanvas.GetComponentInChildren <Button>().onClick.AddListener(() => testButton()); //GameObject button = (GameObject)Instantiate(buildCanvas); //button.GetComponentInChildren<Text>().text = "Marv"; //Check to see if you can place a tower Debug.Log("spot clicked"); //Close the stats panel ButtonScript.statPanel.SetActive(false); towerManager.DeselectAll(); ButtonScript.buildOptionsPanel.SetActive(true); ButtonScript.selectedTower = this.gameObject; //set the tower to be the clicked object }