private void Select() { bool success = defenderSpawner.SelectDefender(defenderPrefab, this); if (success) { spriteRenderer.color = Color.white; } }
private void OnMouseDown() { ChangeButtonColor(Color.white); spawner.SelectDefender(defenderPrefab); foreach (DefenderButton button in FindObjectsOfType <DefenderButton>()) { if (button != this) { button.ChangeButtonColor(Color.gray); } } }
private void SelectDefender(Defender selectedDefender) { DefenderSpawner spawner = FindObjectOfType <DefenderSpawner>(); spawner.SelectDefender(selectedDefender); }