private void OnCollisionEnter2D(Collision2D other) { if (tag != "incassable") { _currentHit++; if (_currentHit >= nbscoupMax) { _niveau.enleverBrique(); Destroy(gameObject, 0f); FindObjectOfType <etatJeu>().ajouterPoints(_valPoint); } else { GetComponent <SpriteRenderer>().sprite = _imageBloc[_currentHit]; } } }
private void OnCollisionEnter2D(Collision2D other) { AudioSource.PlayClipAtPoint(_audioclip, Camera.main.transform.position, 0.5f); if (tag != "incassable") { _currentHit++; if (_currentHit >= nbscoupMax) { _niveau.enleverBrique(); Destroy(gameObject, 0f); FindObjectOfType <etatJeu>().ajouterPoints(_valPoint); } else { GetComponent <SpriteRenderer>().sprite = _imageBloc[_currentHit]; } } }
private void OnCollisionEnter2D(Collision2D collision) { AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position); if (tag != "Indestruc") { _Degat++; if (_Degat >= _hitMax) { if (tag == "Special") { FindObjectOfType <Ball>().newBall(); } Destroy(gameObject, 0f); _niveau.enleverBrique(); FindObjectOfType <etatJeu>().addPoint(_point); } else { GetComponent <SpriteRenderer>().sprite = _BlockDegat[_Degat - 1]; } } }