EndGroup
How do I use End Group
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
214 | GUI.EndGroup(); | 1 |
62 | GUI.EndGroup(); | 2 |
File name: PhotonTransformViewEditor.cs
Copy
203 private void DrawHelpBox(ref Rect propertyRect, bool isOpen, float height, string helpText, string url)
204 {
205 if (isOpen == true)
206 {
207 Rect helpRect = new Rect(propertyRect.xMin, propertyRect.yMin, propertyRect.width, height - 5);
208 GUI.BeginGroup(helpRect, GUI.skin.box);
209 GUI.Label(new Rect(5, 5, propertyRect.width - 10, height - 30), helpText, PhotonGUI.RichLabel);
210 if (GUI.Button(new Rect(5, height - 30, propertyRect.width - 10, 20), "Read more in our documentation"))
211 {
212 Application.OpenURL(url);
213 }
214 GUI.EndGroup();
215
216 propertyRect.y += height;
217 }
218 }
File name: ScrollHelp.cs
Copy
44 public void OnGUI()
45 {
46 GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(Screen.width / 800f, Screen.height / 480f, 1f));
47 GUI.BeginGroup(bounds);
48
49 // scrollPosition = GUI.BeginScrollView(new Rect(0, 0, 538, 350), scrollPosition, new Rect(0, 0, 538 * 4 + 30, 330));
50
51 GUILayout.BeginHorizontal(GUILayout.Width(538), GUILayout.Height(322));
52
53 GUI.DrawTexture(rect1, textureHelps[0]);
54 GUI.DrawTexture(rect2, textureHelps[1]);
55 GUI.DrawTexture(rect3, textureHelps[2]);
56 GUI.DrawTexture(rect4, textureHelps[3]);
57
58 GUILayout.EndHorizontal();
59
60 // GUI.EndScrollView();
61
62 GUI.EndGroup();
63 }
EndGroup 123 lượt xem
Gõ tìm kiếm nhanh...