Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var model : GameObject;
- var track : AudioSource;
- function OnGUI () {
- //background box
- GUI.Box (Rect (10,130,100,90), "Sounds");
- //Make first button
- if (GUI.Button (Rect(20,160,80,20), "Go")){
- audio.clip = track;
- audio.loop = false;
- audio.Play();
- }
- //Make second button
- if (GUI.Button (Rect(20,190,80,20), "Stop")){
- audio.Stop();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment