-
Notifications
You must be signed in to change notification settings - Fork 3
/
ExampleMenu.cs
33 lines (31 loc) · 1009 Bytes
/
ExampleMenu.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
using System.Collections;
using System.Collections.Generic;
public class ExampleMenu : GeneralUISystemWithNavigation
{
IEnumerator Start()
{
while (!UIManager.Instance.DefaultUIStarted)
yield return null;
yield return CoroutineUtility.WaitRealtime(1f);
OpenMenu();
}
protected override void InitializeUI()
{
WindowUI systemWindow = NewWindow("Example Menu", DefaultSetup);
AddButton("All window elements available", systemWindow, () => OpenSubMenu(0));
AddButton("Multiple window example", systemWindow, () => OpenSubMenu(1));
AddButton("中文顯示", systemWindow, () => OpenSubMenu(2));
AddButton("Setting", systemWindow, () => OpenSubMenu(3));
AddGap(systemWindow);
AddButton("Quit", systemWindow, Quit);
systemWindow.AutoResize();
}
void Quit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}