@@ -80,7 +80,11 @@ internal void RefreshComponentList()
80
80
text . text = UISyntaxHighlight . ParseFullSyntax ( ReflectionHelpers . GetActualType ( comp ) , true ) ;
81
81
82
82
var toggle = s_compToggles [ i ] ;
83
+ #if CPP
84
+ if ( comp . TryCast < Behaviour > ( ) is Behaviour behaviour )
85
+ #else
83
86
if ( comp is Behaviour behaviour )
87
+ #endif
84
88
{
85
89
if ( ! toggle . gameObject . activeSelf )
86
90
toggle . gameObject . SetActive ( true ) ;
@@ -130,7 +134,7 @@ internal static void OnCompListPageTurn()
130
134
}
131
135
132
136
133
- #region UI CONSTRUCTION
137
+ #region UI CONSTRUCTION
134
138
135
139
internal void ConstructCompList ( GameObject parent )
136
140
{
@@ -168,34 +172,34 @@ internal void AddCompListButton()
168
172
{
169
173
int thisIndex = s_compListTexts . Count ;
170
174
171
- GameObject btnGroupObj = UIFactory . CreateHorizontalGroup ( s_compListContent , new Color ( 0.07f , 0.07f , 0.07f ) ) ;
172
- HorizontalLayoutGroup btnGroup = btnGroupObj . GetComponent < HorizontalLayoutGroup > ( ) ;
173
- btnGroup . childForceExpandWidth = true ;
174
- btnGroup . childControlWidth = true ;
175
- btnGroup . childForceExpandHeight = false ;
176
- btnGroup . childControlHeight = true ;
177
- btnGroup . childAlignment = TextAnchor . MiddleLeft ;
178
- LayoutElement btnLayout = btnGroupObj . AddComponent < LayoutElement > ( ) ;
179
- btnLayout . minWidth = 25 ;
180
- btnLayout . flexibleWidth = 999 ;
181
- btnLayout . minHeight = 25 ;
182
- btnLayout . flexibleHeight = 0 ;
183
- btnGroupObj . AddComponent < Mask > ( ) ;
175
+ GameObject groupObj = UIFactory . CreateHorizontalGroup ( s_compListContent , new Color ( 0.07f , 0.07f , 0.07f ) ) ;
176
+ HorizontalLayoutGroup group = groupObj . GetComponent < HorizontalLayoutGroup > ( ) ;
177
+ group . childForceExpandWidth = true ;
178
+ group . childControlWidth = true ;
179
+ group . childForceExpandHeight = false ;
180
+ group . childControlHeight = true ;
181
+ group . childAlignment = TextAnchor . MiddleLeft ;
182
+ LayoutElement groupLayout = groupObj . AddComponent < LayoutElement > ( ) ;
183
+ groupLayout . minWidth = 25 ;
184
+ groupLayout . flexibleWidth = 999 ;
185
+ groupLayout . minHeight = 25 ;
186
+ groupLayout . flexibleHeight = 0 ;
187
+ groupObj . AddComponent < Mask > ( ) ;
184
188
185
189
// Behaviour enabled toggle
186
190
187
- var toggleObj = UIFactory . CreateToggle ( btnGroupObj , out Toggle toggle , out Text toggleText , new Color ( 0.3f , 0.3f , 0.3f ) ) ;
191
+ var toggleObj = UIFactory . CreateToggle ( groupObj , out Toggle toggle , out Text toggleText , new Color ( 0.3f , 0.3f , 0.3f ) ) ;
188
192
var toggleLayout = toggleObj . AddComponent < LayoutElement > ( ) ;
189
193
toggleLayout . minHeight = 25 ;
190
194
toggleLayout . minWidth = 25 ;
191
195
toggleText . text = "" ;
192
- toggle . isOn = false ;
196
+ toggle . isOn = true ;
193
197
s_compToggles . Add ( toggle ) ;
194
198
toggle . onValueChanged . AddListener ( ( bool val ) => { OnCompToggleClicked ( thisIndex , val ) ; } ) ;
195
199
196
200
// Main component button
197
201
198
- GameObject mainButtonObj = UIFactory . CreateButton ( btnGroupObj ) ;
202
+ GameObject mainButtonObj = UIFactory . CreateButton ( groupObj ) ;
199
203
LayoutElement mainBtnLayout = mainButtonObj . AddComponent < LayoutElement > ( ) ;
200
204
mainBtnLayout . minHeight = 25 ;
201
205
mainBtnLayout . flexibleHeight = 0 ;
@@ -224,6 +228,6 @@ internal void AddCompListButton()
224
228
}
225
229
226
230
227
- #endregion
231
+ #endregion
228
232
}
229
233
}
0 commit comments