@@ -17,13 +17,15 @@ public class GUIUnstrip
17
17
{
18
18
public static int s_ScrollControlId ;
19
19
20
- public static bool ScrollFailed = false ;
20
+ public static bool ScrollFailed = true ;
21
21
public static bool ManualUnstripFailed = false ;
22
22
23
23
private static GenericStack ScrollStack => m_scrollStack ?? GetScrollStack ( ) ;
24
24
private static PropertyInfo m_scrollViewStatesInfo ;
25
25
private static GenericStack m_scrollStack ;
26
26
27
+ public static DateTime nextScrollStepTime ;
28
+
27
29
private static GenericStack GetScrollStack ( )
28
30
{
29
31
if ( m_scrollViewStatesInfo == null )
@@ -55,7 +57,6 @@ public static void Space(float pixels)
55
57
GUIUtility . CheckOnGUI ( ) ;
56
58
57
59
if ( GUILayoutUtility . current . topLevel . isVertical )
58
-
59
60
LayoutUtilityUnstrip . GetRect ( 0 , pixels , GUILayoutUtility . spaceStyle , new GUILayoutOption [ ] { GUILayout . Height ( pixels ) } ) ;
60
61
else
61
62
LayoutUtilityUnstrip . GetRect ( pixels , 0 , GUILayoutUtility . spaceStyle , new GUILayoutOption [ ] { GUILayout . Width ( pixels ) } ) ;
@@ -66,6 +67,78 @@ public static void Space(float pixels)
66
67
}
67
68
}
68
69
70
+ // Fix for BeginArea
71
+
72
+ static public void BeginArea ( Rect screenRect ) { BeginArea ( screenRect , GUIContent . none , GUIStyle . none ) ; }
73
+ static public void BeginArea ( Rect screenRect , string text ) { BeginArea ( screenRect , GUIContent . Temp ( text ) , GUIStyle . none ) ; }
74
+ static public void BeginArea ( Rect screenRect , Texture image ) { BeginArea ( screenRect , GUIContent . Temp ( image ) , GUIStyle . none ) ; }
75
+ static public void BeginArea ( Rect screenRect , GUIContent content ) { BeginArea ( screenRect , content , GUIStyle . none ) ; }
76
+ static public void BeginArea ( Rect screenRect , GUIStyle style ) { BeginArea ( screenRect , GUIContent . none , style ) ; }
77
+ static public void BeginArea ( Rect screenRect , string text , GUIStyle style ) { BeginArea ( screenRect , GUIContent . Temp ( text ) , style ) ; }
78
+ static public void BeginArea ( Rect screenRect , Texture image , GUIStyle style ) { BeginArea ( screenRect , GUIContent . Temp ( image ) , style ) ; }
79
+
80
+ // Begin a GUILayout block of GUI controls in a fixed screen area.
81
+ static public void BeginArea ( Rect screenRect , GUIContent content , GUIStyle style )
82
+ {
83
+ GUILayoutGroup g = GUILayoutUtility . BeginLayoutArea ( style , Il2CppType . Of < GUILayoutGroup > ( ) ) ;
84
+ if ( Event . current . type == EventType . Layout )
85
+ {
86
+ g . resetCoords = true ;
87
+ g . minWidth = g . maxWidth = screenRect . width ;
88
+ g . minHeight = g . maxHeight = screenRect . height ;
89
+ g . rect = Rect . MinMaxRect ( screenRect . xMin , screenRect . yMin , g . rect . xMax , g . rect . yMax ) ;
90
+ }
91
+
92
+ GUI . BeginGroup ( g . rect , content , style ) ;
93
+ }
94
+
95
+ // Close a GUILayout block started with BeginArea
96
+ static public void EndArea ( )
97
+ {
98
+ if ( Event . current . type == EventType . Used )
99
+ return ;
100
+ GUILayoutUtility . current . layoutGroups . Pop ( ) ;
101
+ GUILayoutUtility . current . topLevel = GUILayoutUtility . current . layoutGroups . Peek ( ) . TryCast < GUILayoutGroup > ( ) ;
102
+ GUI . EndGroup ( ) ;
103
+ }
104
+
105
+ // Fix for BeginGroup
106
+
107
+ public static void BeginGroup ( Rect position ) { BeginGroup ( position , GUIContent . none , GUIStyle . none ) ; }
108
+ public static void BeginGroup ( Rect position , string text ) { BeginGroup ( position , GUIContent . Temp ( text ) , GUIStyle . none ) ; }
109
+ public static void BeginGroup ( Rect position , Texture image ) { BeginGroup ( position , GUIContent . Temp ( image ) , GUIStyle . none ) ; }
110
+ public static void BeginGroup ( Rect position , GUIContent content ) { BeginGroup ( position , content , GUIStyle . none ) ; }
111
+ public static void BeginGroup ( Rect position , GUIStyle style ) { BeginGroup ( position , GUIContent . none , style ) ; }
112
+ public static void BeginGroup ( Rect position , string text , GUIStyle style ) { BeginGroup ( position , GUIContent . Temp ( text ) , style ) ; }
113
+ public static void BeginGroup ( Rect position , Texture image , GUIStyle style ) { BeginGroup ( position , GUIContent . Temp ( image ) , style ) ; }
114
+
115
+ public static void BeginGroup ( Rect position , GUIContent content , GUIStyle style ) { BeginGroup ( position , content , style , Vector2 . zero ) ; }
116
+
117
+ internal static void BeginGroup ( Rect position , GUIContent content , GUIStyle style , Vector2 scrollOffset )
118
+ {
119
+ int id = GUIUtility . GetControlID ( GUI . s_BeginGroupHash , FocusType . Passive ) ;
120
+
121
+ if ( content != GUIContent . none || style != GUIStyle . none )
122
+ {
123
+ switch ( Event . current . type )
124
+ {
125
+ case EventType . Repaint :
126
+ style . Draw ( position , content , id ) ;
127
+ break ;
128
+ default :
129
+ if ( position . Contains ( Event . current . mousePosition ) )
130
+ GUIUtility . mouseUsed = true ;
131
+ break ;
132
+ }
133
+ }
134
+ GUIClip . Push ( position , scrollOffset , Vector2 . zero , false ) ;
135
+ }
136
+
137
+ public static void EndGroup ( )
138
+ {
139
+ GUIClip . Internal_Pop ( ) ;
140
+ }
141
+
69
142
// Fix for BeginScrollView.
70
143
71
144
public static Vector2 BeginScrollView ( Vector2 scroll , params GUILayoutOption [ ] options )
@@ -120,8 +193,6 @@ public static void EndScrollView(bool handleScrollWheel = true)
120
193
private static Vector2 BeginScrollView_ImplLayout ( Vector2 scrollPosition , bool alwaysShowHorizontal , bool alwaysShowVertical ,
121
194
GUIStyle horizontalScrollbar , GUIStyle verticalScrollbar , GUIStyle background , params GUILayoutOption [ ] options )
122
195
{
123
- GUIUtility . CheckOnGUI ( ) ;
124
-
125
196
var guiscrollGroup = GUILayoutUtility . BeginLayoutGroup ( background , null , Il2CppType . Of < GUIScrollGroup > ( ) )
126
197
. TryCast < GUIScrollGroup > ( ) ;
127
198
@@ -396,12 +467,12 @@ private static bool ScrollerRepeatButton_Impl(int scrollerID, Rect rect, GUIStyl
396
467
if ( flag )
397
468
{
398
469
result = true ;
399
- GUI . nextScrollStepTime = Il2CppSystem . DateTime . Now . AddMilliseconds ( 250.0 ) ;
470
+ nextScrollStepTime = DateTime . Now . AddMilliseconds ( 250.0 ) ;
400
471
}
401
- else if ( Il2CppSystem . DateTime . Now >= GUI . nextScrollStepTime )
472
+ else if ( DateTime . Now >= nextScrollStepTime )
402
473
{
403
474
result = true ;
404
- GUI . nextScrollStepTime = Il2CppSystem . DateTime . Now . AddMilliseconds ( 30.0 ) ;
475
+ nextScrollStepTime = DateTime . Now . AddMilliseconds ( 30.0 ) ;
405
476
}
406
477
if ( Event . current . type == EventType . Repaint )
407
478
{
0 commit comments