void OpeningGame() { GUI.skin = menuSkin; float screenX = Screen.width * 0.5f - width * 0.5f; float screenY = Screen.height * 0.5f + height * 0.5f; GUILayout.BeginArea(new Rect(screenX, screenY, width, height)); if (GUILayout.Button("1P Game")) { showMenu = false; currentMenu = MainMenu; Application.LoadLevel("DD"); } if (GUILayout.Button("Multiplayer Game")) { GameObject menuObj = GameObject.Find("NetworkChat"); MPBase2 menu = menuObj.GetComponent <MPBase2>(); menu.Toggle(); currentMenu = MultiplayerMenu; } GUILayout.EndArea(); }
// Update is called once per frame void Update() { if (Application.loadedLevelName == "Opening") { return; } if (Input.GetKeyDown(KeyCode.Escape)) { GameObject menuObj = GameObject.Find("Menu"); MenuGUI menu = menuObj.GetComponent <MenuGUI>(); menu.Toggle(); //SetMotionStatus(!menu.ShowMenu); } if (Input.GetKeyDown(KeyCode.F3)) { GameObject menuObj = GameObject.Find("NetworkChat"); MPBase2 menu = menuObj.GetComponent <MPBase2>(); menu.Toggle(); //SetMotionStatus(!menu.ShowMenu); } }
void MultiplayerMenu() { GUI.skin = menuSkin; float screenX = Screen.width * 0.5f - width * 0.5f; float screenY = Screen.height * 0.5f + height * 0.5f; GUILayout.BeginArea(new Rect(screenX, screenY, width, height)); if (GUILayout.Button("Return")) { GameObject menuObj = GameObject.Find("NetworkChat"); MPBase2 menu = menuObj.GetComponent <MPBase2>(); menu.Toggle(); currentMenu = OpeningGame; } GUILayout.EndArea(); }