Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEditor.Rendering.Analytics;
- using UnityEngine;
- public class BricksScript : MonoBehaviour
- {
- public int life = 1;
- // Start is called once before the first execution of Update after the MonoBehaviour is created
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- }
- private void OnCollisionEnter(Collision collision)
- {
- if (collision.gameObject.tag == "Ball")
- {
- life--;
- if (life <= 0)
- {
- GameManager.instance.bricks.Remove(this.gameObject);
- Destroy(gameObject);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement