-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModalDialog.cs
42 lines (34 loc) · 899 Bytes
/
ModalDialog.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections;
using UnityEngine;
namespace Assets
{
public class ModalDialog : MonoBehaviour
{
public string content;
public int windowId;
public bool isRestart = false;
public bool isExit = false;
public Rect rect;
// Use this for initialization
void Start()
{
}
private void OnGUI()
{
GUI.ModalWindow(windowId, rect, WindowDoFunc, content);
}
void WindowDoFunc(int winId)
{
isRestart = GUI.Button(new Rect(0, Screen.height/5f, 100, 20), "重新开始");
isExit = GUI.Button(new Rect(100, Screen.height / 5f, 80, 20), "退出");
if (isExit)
{
Application.Quit();
}
}
// Update is called once per frame
void Update()
{
}
}
}