private void OnMouseDown() { if (!_isFreezed) { clicksToDestroy--; if (clicksToDestroy <= 0) { gameProxy.AddScore(score); Destroy(gameObject); } } }
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(); } } }