Hello,
Lately, I’ve been having trouble adding an audio trigger to one of my buttons. You see, what I want to do is when the mouse rolls over a button, I want it to make a sound. I already have the sound file called “Roll.” Now, I just want to add the trigger. Here’s the code so far. BTW, it’s in C#.
using UnityEngine;
using System.Collections;
public class HomeButton : MonoBehaviour
{
void OnMouseEnter()
{
transform.Translate(0, 0, 1);
renderer.material.color = Color.blue;
}
void OnMouseExit()
{
transform.Translate(0, 0, -1);
renderer.material.color = Color.white;
}
void OnMouseDown()
{
if(isQuit)
{
Application.Quit();
}
else
{
Application.LoadLevel("Menu");
}
}
}
Please respond back ASAP.
Regards,
Silent-11