42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class PauseMenu : MenuLayer {
|
|
public override string Name { get {return "PauseMenu"; } }
|
|
|
|
public override void Draw(){
|
|
float w = (float)Screen.width;
|
|
float h = (float)Screen.height;
|
|
|
|
float buttonHeight = 40;
|
|
float buttonWidth = 200;
|
|
float buttonSpacing = 10;
|
|
float buttonOffset = buttonHeight + buttonSpacing;
|
|
|
|
float buttonBlockHeight = buttonOffset * 4;
|
|
float buttonBlockVOffset = (h - buttonBlockHeight) * 0.5f;
|
|
float buttonBlockHOffset = (w - buttonWidth) * 0.5f;
|
|
|
|
if (GUI.Button (new Rect (buttonBlockHOffset, buttonBlockVOffset + buttonOffset * 0, buttonWidth, buttonHeight), "Продолжить")) {
|
|
manager.ActivateMenu("");
|
|
}
|
|
GUI.Button (new Rect (buttonBlockHOffset, buttonBlockVOffset + buttonOffset * 1, buttonWidth, buttonHeight), "Настройки");
|
|
if (GUI.Button (new Rect (buttonBlockHOffset, buttonBlockVOffset + buttonOffset * 2, buttonWidth, buttonHeight), "Главное меню")) {
|
|
gameManager.MainMenu();
|
|
}
|
|
|
|
|
|
if (GUI.Button (new Rect (buttonBlockHOffset, buttonBlockVOffset + buttonOffset * 3, buttonWidth, buttonHeight), "Выход")) {
|
|
Application.Quit();
|
|
}
|
|
}
|
|
|
|
public override void Enter(){
|
|
Debug.Log ("Set time scale to 0");
|
|
Time.timeScale = 0.0f;
|
|
}
|
|
public override void Leave(){
|
|
Time.timeScale = 1.0f;
|
|
}
|
|
}
|