File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using UnityEngine ;
1+ using UnityEngine ;
22using UnityEngine . SceneManagement ;
33using UnityEditor ;
44using System . Collections ;
@@ -89,8 +89,10 @@ protected void OnGUI()
8989 for ( ; i < l ; ++ i ) names [ i ] = controllers [ i ] . gameObject . name ;
9090
9191 int index = System . Array . IndexOf < ViewController > ( controllers , _viewController ) ;
92+ if ( index < 0 ) index = 0 ;
93+
9294 index = EditorGUILayout . Popup ( "View Controller" , index , names ) ;
93- controller = controllers [ index ] ;
95+ controller = index >= 0 && index < controllers . Length ? controllers [ index ] : null ;
9496 }
9597
9698 if ( controller != _viewController ) {
@@ -99,7 +101,7 @@ protected void OnGUI()
99101 _viewController = controller ;
100102 }
101103
102- _viewControllerEditor . OnInspectorGUI ( ) ;
104+ if ( _viewControllerEditor != null ) _viewControllerEditor . OnInspectorGUI ( ) ;
103105
104106 } else {
105107
@@ -188,4 +190,4 @@ private void DrawSettingsGUI()
188190
189191 }
190192
191- }
193+ }
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ public override void OnInspectorGUI ()
6767 private void DrawStatsGUI ( )
6868 {
6969 ViewController viewController = target as ViewController ;
70+ if ( viewController == null || viewController . currentLocation == null ) return ;
7071
7172 UViewEditorUtils . LayoutLabelWithPrefix ( "Loaded Resources" , viewController . loadedResourceCount ) ;
7273
Original file line number Diff line number Diff line change 1- using UnityEngine ;
1+ using UnityEngine ;
22using UnityEditor ;
33using UnityEditorInternal ;
44using System . Collections ;
@@ -119,4 +119,4 @@ private void OnSelectedCallback(ReorderableList list)
119119
120120 }
121121
122- }
122+ }
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ public AbstractView[] showingOverlays {
141141 public int loadedResourceCount {
142142 get {
143143 int count = 0 ;
144- foreach ( ViewAsset asset in _assetLookup . Values ) if ( asset . IsResourceLoaded ) count ++ ;
144+ if ( _assetLookup != null ) foreach ( ViewAsset asset in _assetLookup . Values ) if ( asset . IsResourceLoaded ) count ++ ;
145145
146146 return count ;
147147 }
You can’t perform that action at this time.
0 commit comments