Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Blocks : MonoBehaviour
- {
- public int scoreValue;
- public GameObject Block;
- public GameObject[] objects;
- void Start(){
- gameObject.FindGameObjectWithTag ("GameController").GetComponent<GameManager> ().blocksleft;
- }
- void OnCollisionEnter2D(Collision2D collision)
- {
- GameObject.FindGameObjectWithTag("blockbreaksound").GetComponent<AudioSource>().Play();
- GameObject.FindGameObjectsWithTag ("GameController").GetComponent<GameManager> ().blocksleft--;
- Destroy(gameObject);
- // Find all FindGameObjectsWithTag as "Block" and store into an Array
- // if array is 1, SetActive GameOverUI to true, Time.timeScale to 0 //
- // else, just destory the block //
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement