Skip to content

Instantly share code, notes, and snippets.

@Norlself
Last active August 29, 2015 14:17
Show Gist options
  • Save Norlself/367a990c40ec1fc04e53 to your computer and use it in GitHub Desktop.
Save Norlself/367a990c40ec1fc04e53 to your computer and use it in GitHub Desktop.
Unity2 MenuScript.cs
//すでにあるClassを使用するようにします
using UnityEngine;
using System.Collections;
//Classを宣言しています
public class MenuScript : MonoBehaviour {
//初期化するときに処理します
void Start () {
}
//1フレームごとに処理します
void Update () {
}
//UI(GUI)の処理をします
void OnGUI(){
GUI.BeginGroup (new Rect (0, 0, 200, 300));
GUI.Box (new Rect (0, 0, 100, 90), "Menu");
if (GUI.Button (new Rect(10,30,80,20),"Exit")) {
Debug.Log ("Quit Application");
Application.Quit ();
}
GUI.EndGroup ();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment