ButtonTexture
How do I use Button Texture
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
12 | if (ButtonTexture == null) | 1 |
25 | int w = ButtonTexture.width + 4; | 2 |
File name: ToHubButton.cs
Copy
10 void Start ()
11 {
12 if (ButtonTexture == null)
13 {
14 this.gameObject.SetActive(false);
15 return;
16 }
17 DontDestroyOnLoad(this.gameObject);
18
19 }
File name: ToHubButton.cs
Copy
21 public void OnGUI()
22 {
23 if (Application.loadedLevel != 0)
24 {
25 int w = ButtonTexture.width + 4;
26 int h = ButtonTexture.height + 4;
27
28 ButtonRect = new Rect(Screen.width - w, Screen.height - h, w, h);
29 if (GUI.Button(ButtonRect, ButtonTexture, GUIStyle.none))
30 {
31 PhotonNetwork.Disconnect();
32 Application.LoadLevel(0);
33 }
34 }
35 }
ButtonTexture 119 lượt xem
Gõ tìm kiếm nhanh...