void OnMouseDown() { int cost = Button.selectedPrefab.GetComponent <Defender> ().cost; if (starDisplay.UseStar(cost) == status.success) { GameObject newDefender; newDefender = Instantiate(Button.selectedPrefab, CalculateWorldPointOnMouseClick(), Quaternion.identity) as GameObject; newDefender.transform.parent = defenderParent.transform; } else { starDisplay.FlashRed(); } }