コード例 #1
0
 private void HordeTargetExplodes()
 {
     Collider[] collidersInRange = Physics.OverlapSphere(hordeModel.transform.position, hordeModel.blastRadius);
     for (int i = 0; i < collidersInRange.Length; i++)
     {
         CannonController cannon = collidersInRange[i].gameObject.GetComponent <CannonController>();
         if (cannon != null)
         {
             cannon.TakeDamage(hordeModel.hordeDamage);
         }
     }
 }