Hello everyone , i want to do audio effect when button pressed i tried couple things but couldn’t find im using C# , this is my code ;
using UnityEngine;
using System.Collections;
public class Menu : MonoBehaviour {
public GUIStyle buttonStyle ;
public GUIStyle button2;
public AudioClip source1;
void OnGUI ()
{
if(GUI.Button(new Rect(Screen.width/250,Screen.height/10,Screen.width/2,Screen.height/5), "" , buttonStyle))
{
Application.LoadLevel("Level1");
}
if(GUI.Button(new Rect(Screen.width/120,Screen.height/3.9f,Screen.width/2,Screen.height/5), "" , button2))
{
}
}
}