@@ -16,7 +16,13 @@ public class GameObjectInspector : InspectorBase
16
16
{
17
17
public GameObject GOTarget => Target as GameObject ;
18
18
19
- private Text NameText ;
19
+ // Top info
20
+
21
+ private InputFieldRef NameInput ;
22
+ private GameObject PathRow ;
23
+ private InputFieldRef PathInput ;
24
+
25
+ // Child and comp lists
20
26
21
27
public TransformTree TransformTree ;
22
28
private ScrollPool < TransformCell > transformScroll ;
@@ -30,8 +36,6 @@ public override void OnBorrowedFromPool(object target)
30
36
base . OnBorrowedFromPool ( target ) ;
31
37
32
38
Target = target as GameObject ;
33
-
34
- NameText . text = GOTarget . name ;
35
39
Tab . TabText . text = $ "[G] { GOTarget . name } ";
36
40
37
41
RuntimeProvider . Instance . StartCoroutine ( InitCoroutine ( ) ) ;
@@ -191,9 +195,44 @@ public override GameObject CreateContent(GameObject parent)
191
195
UIRoot = UIFactory . CreateVerticalGroup ( Pool < GameObjectInspector > . Instance . InactiveHolder ,
192
196
"GameObjectInspector" , true , true , true , true , 5 , new Vector4 ( 4 , 4 , 4 , 4 ) , new Color ( 0.12f , 0.12f , 0.12f ) ) ;
193
197
194
- NameText = UIFactory . CreateLabel ( UIRoot , "Title" , "not set" , TextAnchor . MiddleLeft , fontSize : 20 ) ;
195
- UIFactory . SetLayoutElement ( NameText . gameObject , minHeight : 30 , flexibleHeight : 0 ) ;
198
+ // Title row
199
+
200
+ var titleRow = UIFactory . CreateUIObject ( "TitleRow" , UIRoot ) ;
201
+ UIFactory . SetLayoutGroup < HorizontalLayoutGroup > ( titleRow , false , false , true , true , 5 ) ;
202
+
203
+ var titleLabel = UIFactory . CreateLabel ( titleRow , "Title" , SignatureHighlighter . Parse ( typeof ( GameObject ) , true ) ,
204
+ TextAnchor . MiddleLeft , fontSize : 17 ) ;
205
+ UIFactory . SetLayoutElement ( titleLabel . gameObject , minHeight : 30 , flexibleHeight : 0 , flexibleWidth : 9999 ) ;
206
+
207
+ // Update button
208
+ var updateBtn = UIFactory . CreateButton ( titleRow , "UpdateButton" , "Update Info" , new Color ( 0.2f , 0.3f , 0.2f ) ) ;
209
+ UIFactory . SetLayoutElement ( updateBtn . Component . gameObject , minHeight : 25 , minWidth : 200 ) ;
210
+ updateBtn . OnClick += ( ) => { ExplorerCore . Log ( "TODO!" ) ; } ;
211
+
212
+ // ~~~~~~ Top info ~~~~~~
213
+
214
+ // parent / path row
215
+
216
+ this . PathRow = UIFactory . CreateUIObject ( "ParentRow" , UIRoot ) ;
217
+ UIFactory . SetLayoutGroup < HorizontalLayoutGroup > ( this . PathRow , false , false , true , true , 5 , 2 , 2 , 2 , 2 ) ;
218
+ UIFactory . SetLayoutElement ( this . PathRow , minHeight : 25 , flexibleHeight : 100 , flexibleWidth : 9999 ) ;
219
+
220
+ var viewParentButton = UIFactory . CreateButton ( PathRow , "ViewParentButton" , "View Parent" , new Color ( 0.3f , 0.3f , 0.3f ) ) ;
221
+ UIFactory . SetLayoutElement ( viewParentButton . Component . gameObject , minHeight : 25 , minWidth : 80 ) ;
222
+ viewParentButton . OnClick += ( ) => { ExplorerCore . LogWarning ( "TODO!" ) ; } ;
223
+
224
+ this . PathInput = UIFactory . CreateInputField ( PathRow , "PathInput" , "No parent (root object)" ) ;
225
+ UIFactory . SetLayoutElement ( PathInput . UIRoot , minHeight : 25 , minWidth : 100 , flexibleWidth : 9999 ) ;
226
+
227
+
228
+ // ~~~~~~ Child and comp lists ~~~~~~
196
229
230
+ var listTitles = UIFactory . CreateUIObject ( "ListTitles" , UIRoot ) ;
231
+ UIFactory . SetLayoutGroup < HorizontalLayoutGroup > ( listTitles , true , true , true , true , 5 , 2 , 2 , 2 , 2 ) ;
232
+ UIFactory . SetLayoutElement ( listTitles , flexibleWidth : 9999 , flexibleHeight : 30 ) ;
233
+ UIFactory . CreateLabel ( listTitles , "ChildListTitle" , "Children" , TextAnchor . MiddleCenter , default , false , 15 ) ;
234
+ UIFactory . CreateLabel ( listTitles , "CompListTitle" , "Components" , TextAnchor . MiddleCenter , default , false , 15 ) ;
235
+
197
236
var listHolder = UIFactory . CreateHorizontalGroup ( UIRoot , "ListHolder" , true , true , true , true , 5 , new Vector4 ( 2 , 2 , 2 , 2 ) ) ;
198
237
UIFactory . SetLayoutElement ( listHolder , flexibleWidth : 9999 , flexibleHeight : 9999 ) ;
199
238
0 commit comments