void handleHits() { breakableCount--; print("destroyed : " + breakableCount); levelmanager.BrickDestroyed(); Destroy(gameObject); }
void HandleHits() { timesHit++; int maxHits = hitSprites.Length + 1; if (timesHit >= maxHits) { breakableCount--; _level_Manager.BrickDestroyed(); PuffSmoke(); Destroy(gameObject); } else { LoadSprites(); } }
void HandleHits() { Vector3 smokePos = gameObject.transform.position; timesHit++; maxHits = hitSprite.Length + 1; print(breakableCount); if (timesHit >= maxHits) { breakableCount--; level_Manager.BrickDestroyed(); GameObject smokePuff; smokePuff = Instantiate(smoke, smokePos, Quaternion.identity); ParticleSystem.MainModule main = smokePuff.GetComponent <ParticleSystem>().main; main.startColor = gameObject.GetComponent <SpriteRenderer>().color; Destroy(gameObject); } else { LoadSprite(); } }