예제 #1
0
 private void OnMouseDown()
 {
     if (!_isFreezed)
     {
         clicksToDestroy--;
         if (clicksToDestroy <= 0)
         {
             gameProxy.AddScore(score);
             Destroy(gameObject);
         }
     }
 }
예제 #2
0
파일: Baloon.cs 프로젝트: votizlov/Unity_1
 private void OnMouseDown()
 {
     if (!_isFreezed)
     {
         clicksToDestroy--;
         HitEvent?.Invoke();
         if (clicksToDestroy <= 0)
         {
             gameProxy.AddScore(score);
             DieEvent?.Invoke();
             explodable.generateFragments();
             foreach (var fragment in explodable.fragments)
             {
                 fragment.AddComponent <ObjectCleaner>();
             }
             gameProxy.AddTime(timeAddedOnDestroy);
             gameProxy.ExplosionForce.doExplosion(transform.position);
             explodable.explode();
         }
     }
 }