@@ -82,25 +82,7 @@ internal static GameObject DontDestroyMe
82
82
}
83
83
private static GameObject dontDestroyObject ;
84
84
85
- public static bool InspectingAssetScene => SelectedScene == AssetScene ;
86
-
87
- internal static Scene AssetScene => AssetObject . scene ;
88
- internal static int AssetHandle => AssetScene . handle ;
89
-
90
- internal static GameObject AssetObject
91
- {
92
- get
93
- {
94
- if ( ! assetObject )
95
- {
96
- assetObject = RuntimeProvider . Instance . FindObjectsOfTypeAll ( typeof ( GameObject ) )
97
- . First ( it => ! it . TryCast < GameObject > ( ) . scene . IsValid ( ) )
98
- . TryCast < GameObject > ( ) ;
99
- }
100
- return assetObject ;
101
- }
102
- }
103
- private static GameObject assetObject ;
85
+ public static bool InspectingAssetScene => ! SelectedScene ? . IsValid ( ) ?? false ;
104
86
105
87
internal static void Init ( )
106
88
{
@@ -122,7 +104,7 @@ internal static void Init()
122
104
catch ( Exception ex )
123
105
{
124
106
gotAllScenesInBuild = false ;
125
- ExplorerCore . Log ( $ "Unable to generate list of all Scenes in the build: { ex } ") ;
107
+ ExplorerCore . LogWarning ( $ "Unable to generate list of all Scenes in the build: { ex } ") ;
126
108
}
127
109
}
128
110
@@ -131,7 +113,7 @@ internal static void Update()
131
113
int curHandle = SelectedScene ? . handle ?? - 1 ;
132
114
// DontDestroyOnLoad always exists, so default to true if our curHandle is that handle.
133
115
// otherwise we will check while iterating.
134
- bool inspectedExists = curHandle == DontDestroyHandle || curHandle == AssetHandle ;
116
+ bool inspectedExists = curHandle == DontDestroyHandle || curHandle == 0 ;
135
117
136
118
// Quick sanity check if the loaded scenes changed
137
119
bool anyChange = LoadedSceneCount != allLoadedScenes . Count ;
@@ -145,7 +127,7 @@ internal static void Update()
145
127
for ( int i = 0 ; i < SceneManager . sceneCount ; i ++ )
146
128
{
147
129
Scene scene = SceneManager . GetSceneAt ( i ) ;
148
- if ( scene == default || scene . handle == - 1 || ! scene . isLoaded )
130
+ if ( scene == default || ! scene . isLoaded )
149
131
continue ;
150
132
151
133
// If no changes yet, ensure the previous list contained this handle.
@@ -161,7 +143,7 @@ internal static void Update()
161
143
162
144
// Always add the DontDestroyOnLoad scene and the "none" scene.
163
145
allLoadedScenes . Add ( DontDestroyScene ) ;
164
- allLoadedScenes . Add ( AssetScene ) ;
146
+ allLoadedScenes . Add ( default ) ;
165
147
166
148
// Default to first scene if none selected or previous selection no longer exists.
167
149
if ( ! inspectedExists )
0 commit comments