private void TurnOn() { isPressed = true; spawner.SetDefender(defenderPrefab); GetComponent <SpriteRenderer>().color = originalColor; costText.color = originalColor; }
private void OnMouseDown() { foreach (DefenderButton button in FindObjectsOfType <DefenderButton>()) { button.GetComponent <SpriteRenderer>().color = Color.black; } GetComponent <SpriteRenderer>().color = Color.white; defenderSpawner.SetDefender(defenderPrefab); }
private void SetNewDefender() { DefenderSpawner spawner = FindObjectOfType <DefenderSpawner>(); if (spawner && defenderObject) { spawner.SetDefender(defenderObject, defenderCost); } }
void OnMouseDown() { var buttons = FindObjectsOfType <DefenderButton>(); foreach (DefenderButton button in buttons) { button.GetComponent <SpriteRenderer>().color = new Color32(40, 40, 40, 255); } gameObject.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1); spawner.SetDefender(myDefender); }
private void SetDefender() { defenderSpawner.SetDefender(defenderPrefab); }