1. Beginfadegroup (float value)this is a function in editorguilayout that hides/displays the contents of the group it contains. Value is the amount of content that is displayed, and the range is 0-1. Compare windows that are not used/used Beginfadegroup: [Code]csharpcode:
Using unityengine;using system.collections;using unityeditor; Reference to the editor namespace public class Editor2:editorwindow//editor class { [MenuItem ("Editordemo/createwindow")]//Add a menu to the editor static void CreateWindow ()//The following function must be * * * static { //In this case Create window Editorwindow.getwindow (typeof (Editor2), False, "Editorwindow", True); } void Ongui () { editorguilayout.beginfadegroup (0.5f);//Group start Guilayout.button ("Button0");//The contents of the group, I wrote this 3 button Guilayout.button ("Button1"); Guilayout.button ("Button2"); Editorguilayout.endfadegroup (); Group End }}
We set the value to 0.5, which is the display 50%; set to 0.75, which is the display 75%.
2. Beginhorizontal ()
Often different GUIs are arranged one by one, and the Beginhorizontal function can display the contents of the group in the same row. (Beginvertical () is the vertical axis arrangement, the use of the same, I will not repeat it)
[Code]csharpcode:
Using unityengine;using system.collections;using unityeditor; Reference to the editor namespace public class Editor2:editorwindow//editor class { [MenuItem ("Editordemo/createwindow")]//Add a menu to the editor static void CreateWindow ()//The following function must be * * * static { //In this case Create window Editorwindow.getwindow (typeof (Editor2), False, "Editorwindow", True); } void Ongui () { editorguilayout.beginhorizontal ();//Group start Guilayout.button ("Button0");//The contents of the Group Guilayout.button ("Button1"); Editorguilayout.endhorizontal (); Group End }}
Compare the unused/used beginhorizontal windows:
3. Beginscrollview ()
The Beginscrollview function can provide a sliding space for a GUI with a large width or height.
[Code]csharpcode:
Using unityengine;using system.collections;using unityeditor; Reference to the editor namespace public class Editor2:editorwindow//editor class { Vector2 _scrollpos; [MenuItem ("Editordemo/createwindow")]//Add a menu in the editor static void CreateWindow ()//The following function must be * * * static { In this case, create the window Editorwindow.getwindow (typeof (Editor2), False, "Editorwindow", true); void Ongui () { _scrollpos = Editorguilayout.beginscrollview (_scrollpos);//Group start Editorguilayout.labelfield ("I am the woo, the small cheap I am the woo, the small base I am the woo, the small base I am the woo, the small base"); The contents of the group Editorguilayout.labelfield ("I am xiaojian I am xiaojian I am xiaojian I am Xiaojian"); Editorguilayout.endscrollview (); Group End }}
Compare windows that are not using/using Beginscrollview:
is not all very simple, those who want to give their own project to do some plug-in children's shoes are all eager!
(GO) Unity Note Editor (Beginfadegroup, Beginhorizontal, Beginscrollview) ...