This section script mainly implements the scaling of A group function . The content in the group, that is, the menu content, can be freely added.
VaR leftgrouptotop: Int = 60; var leftgroupwidth: Int = 300; var weight: Int = 700; var leftgrouplabelwidth: Int = 30; private var movedistance = leftgrouplabelwidth-leftgroupwidth; private var xposition; private var startpoint: Float = movedistance; function Update () {// obtain the X coordinate position of the mouse, xposition = input. mouseposition. x; If (xposition <leftgrouplabelwidth) {openleftgroup ();} If (xposition> leftgroupwidth) {closeleftgroup () ;}} function ongui () {GUI. box (rect (100,400, 0,), xposition. tostring (); // you can remove it and debug the GUI for the effect. box (rect (100,500,100,400), startpoint. tostring (); // can be removed. for debugging, see the effect. // The following figure shows the content GUI in the group. begingroup (rect (startpoint, leftgrouptotop, leftgroupwidth, leftgroupheight); GUI. box (rect (0, 0, leftgroupwidth, leftgroupheight), ""); GUI. box (rect (leftgroupwidth-leftgrouplabelwidth, 0, leftgrouplabelwidth, leftgroupheight), "qiyechaxun"); GUI. endgroup (); // group end} // extended function openleftgroup () {If (startpoint <0.0) {startpoint + = 1.0; yield waitforseconds (2);} of the control menu );}} // function closeleftgroup () {If (startpoint> movedistance) {startpoint-= 0.1; yield waitforseconds (5 );}}