Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Silverkeep/Guardian of Silverkeep/Assets/Scripts/From_John/Button.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
34 lines (26 sloc)
817 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Button : MonoBehaviour { | |
public Texture btnTexture; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
void OnGUI() { | |
if (!btnTexture) { | |
Debug.LogError("Please assign a texture on the inspector"); | |
return; | |
} | |
if (GUI.Button(new Rect(350, 400, 90, 90), btnTexture, GUIStyle.none)){ | |
Debug.Log("Clicked the button with an image"); | |
// TIANZHU!!!! Put scene name here for main game! Replace TeamSplash!!! | |
Application.LoadLevel ("LVL1"); | |
} | |
if (GUI.Button(new Rect(450, 400, 90, 90), "Credits")){ | |
Debug.Log("Clicked the button with text"); | |
Application.LoadLevel ("CreditsPage"); | |
} | |
} | |
} |