GUILayoutUtility.GetLastRect() 's function is to get the last control’s Rect.
while the following code seem not to be workable.
private Rect Rect_Btn;
GUILayout.Button(...) ;
Rect_Btn = GUILayoutUtility.GetLastRect();
if(Rect_Btn.Contains(Event.current.mousePosition))
{
GUILayout.BeginArea(Rect_Btn.xMax, Rect_Btn.y,width,height);
....
GUILayout.EndArea();
}
it seem to be that Rect_Btn could be got.the Area appears at(0,0),not(Rect_Btn.xMax, Rect_Btn.y).
I don’t know why.