Fix JumpToTransform exception with HideAndDontSave

This commit is contained in:
Sinai 2022-04-12 00:27:05 +10:00
parent 409a468b55
commit 8f1f6cd0b2

View File

@ -79,7 +79,11 @@ namespace UnityExplorer.ObjectExplorer
var go = transform.gameObject;
if (SceneHandler.SelectedScene != go.scene)
{
int idx = sceneDropdown.options.IndexOf(sceneToDropdownOption[go.scene]);
int idx;
if (go.scene == default || go.scene.handle == -1)
idx = sceneDropdown.options.Count - 1;
else
idx = sceneDropdown.options.IndexOf(sceneToDropdownOption[go.scene]);
sceneDropdown.value = idx;
}