Add CollectCoins
This commit is contained in:
1 parent
15fe1e4ce1
commit
d8731c1c23
91 files changed
+241
-38
No files matched your search
@@ -0,0 +1,47 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
[RequireComponent (typeof(AudioSource))]
|
||||
public class MainMenuButtonScript : MonoBehaviour {
|
||||
|
||||
public string levelToLoad;
|
||||
public Texture2D startTexture;
|
||||
public Texture2D rollOverTexture;
|
||||
public bool isPlayButton = false;
|
||||
public bool isQuitButton = false;
|
||||
public AudioClip beep;
|
||||
|
||||
|
||||
void OnMouseEnter()
|
||||
{
|
||||
guiTexture.texture = rollOverTexture;
|
||||
}
|
||||
|
||||
void OnMouseExit()
|
||||
{
|
||||
guiTexture.texture = startTexture;
|
||||
}
|
||||
|
||||
IEnumerator OnMouseUp()
|
||||
{
|
||||
audio.PlayOneShot(beep);
|
||||
yield return new WaitForSeconds(0.35f);
|
||||
if (isQuitButton )
|
||||
{
|
||||
Application.Quit();
|
||||
} else if (isPlayButton )
|
||||
{
|
||||
Application.LoadLevel(levelToLoad);
|
||||
}
|
||||
}
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user