using UnityEngine;
using System.Collections;
public class MainCamera : MonoBehaviour
{
private bool sw = false; //另外視窗開關
void OnGUI ()
{
// 換場景
if (GUI.Button (new Rect (20, 20, 100, 50), "Play")) {
Application.LoadLevel("Startgame"); //場景名稱
}
if (GUI.Button (new Rect (20, 80, 100, 50), "Game Guide"))
sw = true;
if (sw == true)
GameGuide ();
else sw = false;
}
void GameGuide ()
{
GUI.Window (0, new Rect(360,30,400,300), DoMyWindow, "Game Guide"); // GUI.window(編號 , 位置 , 視窗底下方法 , "視窗名稱" )
}
// 寫入視窗方法
void DoMyWindow (int windowID)
{
GUI.Label(new Rect(10,20,100,20), "Computer keys: ");
GUI.Label(new Rect(30,40,100,20), "Laft: a");
GUI.Label(new Rect(30,60,100,20), "Right: d");
GUI.Label(new Rect(30,80,200,20), "Fired bullets: spacebar");
GUI.Label(new Rect(30,100,200,20), "Leave game: Esc / y");
if(GUI.Button(new Rect(150,260,100,20),"Exit")){
Application.LoadLevel("feelPlaygame");
}
}
}