@@ -18,11 +18,11 @@ namespace UnityExplorer.Inspectors
18
18
{
19
19
public class GameObjectInspector : InspectorBase
20
20
{
21
- public GameObject GOTarget => Target as GameObject ;
21
+ public new GameObject Target => base . Target as GameObject ;
22
22
23
23
public GameObject Content ;
24
24
25
- public GameObjectControls GOControls ;
25
+ public GameObjectControls Controls ;
26
26
27
27
public TransformTree TransformTree ;
28
28
private ScrollPool < TransformCell > transformScroll ;
@@ -38,10 +38,10 @@ public override void OnBorrowedFromPool(object target)
38
38
{
39
39
base . OnBorrowedFromPool ( target ) ;
40
40
41
- Target = target as GameObject ;
41
+ base . Target = target as GameObject ;
42
42
43
- GOControls . UpdateGameObjectInfo ( true , true ) ;
44
- GOControls . UpdateTransformControlValues ( true ) ;
43
+ Controls . UpdateGameObjectInfo ( true , true ) ;
44
+ Controls . TransformControl . UpdateTransformControlValues ( true ) ;
45
45
46
46
RuntimeHelper . StartCoroutine ( InitCoroutine ( ) ) ;
47
47
}
@@ -76,9 +76,9 @@ public override void CloseInspector()
76
76
77
77
public void OnTransformCellClicked ( GameObject newTarget )
78
78
{
79
- this . Target = newTarget ;
80
- GOControls . UpdateGameObjectInfo ( true , true ) ;
81
- GOControls . UpdateTransformControlValues ( true ) ;
79
+ base . Target = newTarget ;
80
+ Controls . UpdateGameObjectInfo ( true , true ) ;
81
+ Controls . TransformControl . UpdateTransformControlValues ( true ) ;
82
82
TransformTree . RefreshData ( true , false , true , false ) ;
83
83
UpdateComponents ( ) ;
84
84
}
@@ -90,21 +90,21 @@ public override void Update()
90
90
if ( ! this . IsActive )
91
91
return ;
92
92
93
- if ( Target . IsNullOrDestroyed ( false ) )
93
+ if ( base . Target . IsNullOrDestroyed ( false ) )
94
94
{
95
95
InspectorManager . ReleaseInspector ( this ) ;
96
96
return ;
97
97
}
98
98
99
- GOControls . UpdateVectorSlider ( ) ;
100
- GOControls . UpdateTransformControlValues ( false ) ;
99
+ Controls . UpdateVectorSlider ( ) ;
100
+ Controls . TransformControl . UpdateTransformControlValues ( false ) ;
101
101
102
102
// Slow update
103
103
if ( timeOfLastUpdate . OccuredEarlierThan ( 1 ) )
104
104
{
105
105
timeOfLastUpdate = Time . realtimeSinceStartup ;
106
106
107
- GOControls . UpdateGameObjectInfo ( false , false ) ;
107
+ Controls . UpdateGameObjectInfo ( false , false ) ;
108
108
109
109
TransformTree . RefreshData ( true , false , false , false ) ;
110
110
UpdateComponents ( ) ;
@@ -115,12 +115,12 @@ public override void Update()
115
115
116
116
private IEnumerable < GameObject > GetTransformEntries ( )
117
117
{
118
- if ( ! GOTarget )
118
+ if ( ! Target )
119
119
return Enumerable . Empty < GameObject > ( ) ;
120
120
121
121
cachedChildren . Clear ( ) ;
122
- for ( int i = 0 ; i < GOTarget . transform . childCount ; i ++ )
123
- cachedChildren . Add ( GOTarget . transform . GetChild ( i ) . gameObject ) ;
122
+ for ( int i = 0 ; i < Target . transform . childCount ; i ++ )
123
+ cachedChildren . Add ( Target . transform . GetChild ( i ) . gameObject ) ;
124
124
return cachedChildren ;
125
125
}
126
126
@@ -130,11 +130,11 @@ private IEnumerable<GameObject> GetTransformEntries()
130
130
private readonly List < bool > behaviourEnabledStates = new ( ) ;
131
131
132
132
// ComponentList.GetRootEntriesMethod
133
- private List < Component > GetComponentEntries ( ) => GOTarget ? componentEntries : Enumerable . Empty < Component > ( ) . ToList ( ) ;
133
+ private List < Component > GetComponentEntries ( ) => Target ? componentEntries : Enumerable . Empty < Component > ( ) . ToList ( ) ;
134
134
135
135
public void UpdateComponents ( )
136
136
{
137
- if ( ! GOTarget )
137
+ if ( ! Target )
138
138
{
139
139
componentEntries . Clear ( ) ;
140
140
compInstanceIDs . Clear ( ) ;
@@ -146,8 +146,8 @@ public void UpdateComponents()
146
146
}
147
147
148
148
// Check if we actually need to refresh the component cells or not.
149
- IEnumerable < Component > comps = GOTarget . GetComponents < Component > ( ) ;
150
- IEnumerable < Behaviour > behaviours = GOTarget . GetComponents < Behaviour > ( ) ;
149
+ IEnumerable < Component > comps = Target . GetComponents < Component > ( ) ;
150
+ IEnumerable < Behaviour > behaviours = Target . GetComponents < Behaviour > ( ) ;
151
151
152
152
bool needRefresh = false ;
153
153
@@ -231,7 +231,7 @@ public void UpdateComponents()
231
231
private void OnAddChildClicked ( string input )
232
232
{
233
233
GameObject newObject = new ( input ) ;
234
- newObject . transform . parent = GOTarget . transform ;
234
+ newObject . transform . parent = Target . transform ;
235
235
236
236
TransformTree . RefreshData ( true , false , true , false ) ;
237
237
}
@@ -242,7 +242,7 @@ private void OnAddComponentClicked(string input)
242
242
{
243
243
try
244
244
{
245
- RuntimeHelper . AddComponent < Component > ( GOTarget , type ) ;
245
+ RuntimeHelper . AddComponent < Component > ( Target , type ) ;
246
246
UpdateComponents ( ) ;
247
247
}
248
248
catch ( Exception ex )
@@ -270,7 +270,7 @@ public override GameObject CreateContent(GameObject parent)
270
270
UIFactory . SetLayoutGroup < VerticalLayoutGroup > ( Content , spacing : 3 , padTop : 2 , padBottom : 2 , padLeft : 2 , padRight : 2 ) ;
271
271
272
272
// Construct GO Controls
273
- GOControls = new GameObjectControls ( this ) ;
273
+ Controls = new GameObjectControls ( this ) ;
274
274
275
275
ConstructLists ( ) ;
276
276
0 commit comments