public void OnBuffAllBuffTowers() { GameObject[] towers = GameObject.FindGameObjectsWithTag("Tower"); for (int i = 0; i < towers.Length; ++i) { TowerWeapon weapon = towers[i].GetComponent <TowerWeapon>(); if (weapon.WeaponType == WeaponType.Buff) { weapon.OnBuffAroundTower(); } } }