Advertisement
Guest User

Test

a guest
Apr 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class DestroyCubes : MonoBehaviour
  5. {
  6. public AudioClip zvuk;
  7.  
  8. void Start()
  9. {
  10.  
  11. GetComponent<AudioSource>().clip = zvuk;
  12.  
  13. }
  14.  
  15. void OnCollisionEnter (Collision col)
  16. {
  17. if(col.gameObject.name == "floor")
  18. {
  19.  
  20. GetComponent<AudioSource>().Play ();
  21.  
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement