void handleHits() { timesHit++; int maxHits = hitsSprites.Length + 1; if (timesHit >= maxHits) { brickCount--; levelManager.BrickDestroyed(); PuffSmoke(); Destroy(gameObject); } else { LoadSprites(); } }
void HandleHits() { timesHit++; int maxHits = hitSprites.Length + 1; if (timesHit >= maxHits) { breakableCount--; levelManager.BrickDestroyed(); SmokePuff(); Destroy(gameObject); } else { LoadSprites(); } }
void HandleHits() { timesHit++; AudioSource.PlayClipAtPoint(crackSound, transform.position); if (timesHit >= maxHit) { breakableCount--; levelManager.BrickDestroyed(); print("breakable " + breakableCount); GameObject smokePuff = Instantiate(smoke, gameObject.transform.position, Quaternion.identity) as GameObject; smokePuff.GetComponent <ParticleSystem>().startColor = this.GetComponent <SpriteRenderer> ().color; Destroy(gameObject); } else { LoadSprite(); } }
void HandleHits() { int maxHits = hitSprites.Length + 1; amountHits++; if (amountHits >= maxHits) { breakableCount--; Destroy(gameObject); GameObject smokePuff = Instantiate(smoke, gameObject.transform.position, Quaternion.identity) as GameObject; smokePuff.GetComponent <ParticleSystem>().startColor = gameObject.GetComponent <SpriteRenderer>().color; levelManager.BrickDestroyed(breakableCount); } else { LoadSprites(); } }