Advertisement
BaneOfSmite

Untitled

Jul 31st, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Blocks : MonoBehaviour
  5. {
  6. public int scoreValue;
  7. public GameObject Block;
  8. public GameObject[] objects;
  9.  
  10. void Start(){
  11. gameObject.FindGameObjectWithTag ("GameController").GetComponent<GameManager> ().blocksleft;
  12. }
  13.  
  14.  
  15. void OnCollisionEnter2D(Collision2D collision)
  16. {
  17. GameObject.FindGameObjectWithTag("blockbreaksound").GetComponent<AudioSource>().Play();
  18. GameObject.FindGameObjectsWithTag ("GameController").GetComponent<GameManager> ().blocksleft--;
  19. Destroy(gameObject);
  20.  
  21. // Find all FindGameObjectsWithTag as "Block" and store into an Array
  22.  
  23. // if array is 1, SetActive GameOverUI to true, Time.timeScale to 0 //
  24.  
  25. // else, just destory the block //
  26.  
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement