I'm doing a menu for my game and I don't know how to play a sound after the mouse pass through it...
I just made it change the color and load the next level.
for example.
using UnityEngine;
using System.Collections;
public class play : MonoBehaviour {
public bool sair = false;
void OnMouseEnter ()
{
renderer.material.color = Color.blue;
}
void OnMouseExit ()
{
renderer.material.color = Color.white;
}
void OnMouseDown ()
{
if (sair)
{
Application.Quit();
}
else
{
Application.LoadLevel(1);
}
}
}
***
↧