// 3 void OnTriggerExit2D(Collider2D other) { if (other.gameObject.tag.Equals("Enemy")) { enemiesInRange.Remove(other.gameObject); EnemyDelegateDestruction del = other.gameObject.GetComponent <EnemyDelegateDestruction>(); del.enemyDelegate -= OnEnemyDestroy; if (selectionCircle.gameObject.activeSelf) { selectionCircle.gameObject.GetComponent <SpriteRenderer>().color = new Color(0f, 0f, 1f, 0.50f); // Set to red trabsparent } } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag.Equals("Enemy")) { enemiesInRange.Add(other.gameObject); EnemyDelegateDestruction del = other.gameObject.GetComponent <EnemyDelegateDestruction>(); del.enemyDelegate += OnEnemyDestroy; if (selectionCircle.gameObject.activeSelf) { //Change the alpha to keep it transparent selectionCircle.gameObject.GetComponent <SpriteRenderer>().color = new Color(1f, 0f, 0f, 0.50f); // Set to red trabsparent } } }