Esempio n. 1
0
 private void FixedUpdate()
 {
     using (var hits = BoltNetwork.OverlapSphereAll(weaponPosition.position, attackRadius))
     {
         if (mainPlayerMovementFSM.currentState == mainPlayerMovementFSM.attackingReadyState && hits.count > 0)
         {
             for (int i = 0; i < hits.count; ++i)
             {
                 var hit        = hits.GetHit(i);
                 var serializer = hit.body.GetComponent <Damageable>();
                 if (serializer != null)
                 {
                     serializer.TakeDamage(1);
                 }
             }
         }
     }
 }