void doAttack() { Color color = UnityUtils.RecursiveFind(transform, "Image").GetComponent <Image>().color; color.a = 0.0f; float unitCircleRotation = RotationUtils.MakePositiveAngle(transform.eulerAngles.z + 90); Color zeroAlphaColor = color; zeroAlphaColor.a = 0.0f; object[] obj = GameObject.FindObjectsOfType(typeof(GameObject)); foreach (Enemy enemy in GameObject.FindObjectsOfType(typeof(Enemy))) { if (enemy.isInAttackArea(unitCircleRotation - this.currentAttack.angle, unitCircleRotation + this.currentAttack.angle, this.currentAttack.closeRadius, this.currentAttack.farRadius)) { enemy.applyDamageTo(this.currentAttack.damage); } } // For now, change color of boss when he is attacking // TODO: Change when areas of damage is implemented gameObject.GetComponent <SpriteRenderer>().color = Color.red; if (currentCooldownBehaviour != null) { currentCooldownBehaviour.RestartCooldown(); } this.aimColorModifier.FadeToSelected(this.currentAttack.frequency); StartCoroutine(UnityUtils.ChangeToColorAfterTime(gameObject.GetComponent <SpriteRenderer>(), Color.white, 0.5f)); }