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
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour {
void OnGUI()
{
// Make a background box
GUI.Box(new Rect(10, 10, 100, 90), "Loader Menu");
// Make the first button. If it is pressed,
// Application.Loadlevel (1) will be executed
if (GUI.Button(new Rect(20, 40, 80, 20), "Level 1"))
{
Application.LoadLevel(1);
}
// Make the second button.
if (GUI.Button(new Rect(20, 70, 80, 20), "Level 2"))
{
Application.LoadLevel(2);
}
}
}
| cs |
GUI에 대한 Unity메뉴얼 주소 :
https://docs.unity3d.com/kr/current/Manual/gui-Basics.html
댓글
댓글 쓰기