Пример #1
0
 private void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.CompareTag(Tags.Pickup))
     {
         var pickupPowerScript = other.gameObject.GetComponent <PickupPower>();
         _effectsControllerScript.PlayExplosion();
         Destroy(other.gameObject);
         _effectsControllerScript.PlayPickupSound();
         ImproveAbility(pickupPowerScript);
     }
 }
Пример #2
0
 private void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.CompareTag(Tags.Obstacle))
     {
         EventRepo.HitToObstacle.OnRaiseHitToObstacleEvent(this);
         _effectsControllerScript.PlayExplosion();
         if (!GameStateData.GameOver)
         {
             Destroy(other.gameObject);
             _effectsControllerScript.PlayCrashSound();
         }
         else
         {
             _effectsControllerScript.PlayDeathSound();
         }
     }
 }