diff --git a/src/Core/SceneHandler.cs b/src/Core/SceneHandler.cs index b0d633e..dd0363d 100644 --- a/src/Core/SceneHandler.cs +++ b/src/Core/SceneHandler.cs @@ -82,25 +82,7 @@ namespace UnityExplorer.Core } private static GameObject dontDestroyObject; - public static bool InspectingAssetScene => SelectedScene == AssetScene; - - internal static Scene AssetScene => AssetObject.scene; - internal static int AssetHandle => AssetScene.handle; - - internal static GameObject AssetObject - { - get - { - if (!assetObject) - { - assetObject = RuntimeProvider.Instance.FindObjectsOfTypeAll(typeof(GameObject)) - .First(it => !it.TryCast().scene.IsValid()) - .TryCast(); - } - return assetObject; - } - } - private static GameObject assetObject; + public static bool InspectingAssetScene => !SelectedScene?.IsValid() ?? false; internal static void Init() { @@ -122,7 +104,7 @@ namespace UnityExplorer.Core catch (Exception ex) { gotAllScenesInBuild = false; - ExplorerCore.Log($"Unable to generate list of all Scenes in the build: {ex}"); + ExplorerCore.LogWarning($"Unable to generate list of all Scenes in the build: {ex}"); } } @@ -131,7 +113,7 @@ namespace UnityExplorer.Core int curHandle = SelectedScene?.handle ?? -1; // DontDestroyOnLoad always exists, so default to true if our curHandle is that handle. // otherwise we will check while iterating. - bool inspectedExists = curHandle == DontDestroyHandle || curHandle == AssetHandle; + bool inspectedExists = curHandle == DontDestroyHandle || curHandle == 0; // Quick sanity check if the loaded scenes changed bool anyChange = LoadedSceneCount != allLoadedScenes.Count; @@ -145,7 +127,7 @@ namespace UnityExplorer.Core for (int i = 0; i < SceneManager.sceneCount; i++) { Scene scene = SceneManager.GetSceneAt(i); - if (scene == default || scene.handle == -1 || !scene.isLoaded) + if (scene == default || !scene.isLoaded) continue; // If no changes yet, ensure the previous list contained this handle. @@ -161,7 +143,7 @@ namespace UnityExplorer.Core // Always add the DontDestroyOnLoad scene and the "none" scene. allLoadedScenes.Add(DontDestroyScene); - allLoadedScenes.Add(AssetScene); + allLoadedScenes.Add(default); // Default to first scene if none selected or previous selection no longer exists. if (!inspectedExists) diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 9bd8543..74c86b2 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -19,7 +19,7 @@ namespace UnityExplorer public static class ExplorerCore { public const string NAME = "UnityExplorer"; - public const string VERSION = "4.0.3"; + public const string VERSION = "4.0.4"; public const string AUTHOR = "Sinai"; public const string GUID = "com.sinai.unityexplorer"; diff --git a/src/UI/ObjectExplorer/SearchProvider.cs b/src/UI/ObjectExplorer/SearchProvider.cs index 04753e0..8aeca1a 100644 --- a/src/UI/ObjectExplorer/SearchProvider.cs +++ b/src/UI/ObjectExplorer/SearchProvider.cs @@ -45,9 +45,9 @@ namespace UnityExplorer.UI.ObjectExplorer case SceneFilter.DontDestroyOnLoad: return scene == SceneHandler.DontDestroyScene; case SceneFilter.HideAndDontSave: - return scene == SceneHandler.AssetScene; + return scene == default; case SceneFilter.ActivelyLoaded: - return scene != SceneHandler.DontDestroyScene && scene != SceneHandler.AssetScene; + return scene != SceneHandler.DontDestroyScene && scene != default; default: return false; } diff --git a/src/UnityExplorer.csproj b/src/UnityExplorer.csproj index a2cd445..507f7b7 100644 --- a/src/UnityExplorer.csproj +++ b/src/UnityExplorer.csproj @@ -1,377 +1,377 @@  - + + + Release_ML_Cpp + AnyCPU + {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D} + Library + Properties + 512 + true + + + + false + false + false + false + false + none + false + prompt + 4 + x64 + false + UnityExplorer + + + true + + + + + v4.7.2 + ..\Release\UnityExplorer.MelonLoader.Il2Cpp\ + CPP,ML + UnityExplorer.ML.IL2CPP + true + true + + + + v3.5 + ..\Release\UnityExplorer.MelonLoader.Mono\ + MONO,ML + UnityExplorer.ML.Mono + false + false + true + + + + v4.7.2 + ..\Release\UnityExplorer.BepInEx.Il2Cpp\ + CPP,BIE,BIE6 + UnityExplorer.BIE.IL2CPP + true + true + + + + v3.5 + ..\Release\UnityExplorer.BepInEx6.Mono\ + MONO,BIE,BIE6 + UnityExplorer.BIE6.Mono + false + true + + + + v3.5 + ..\Release\UnityExplorer.BepInEx5.Mono\ + MONO,BIE,BIE5 + UnityExplorer.BIE5.Mono + false + true + + + + v3.5 + ..\Release\UnityExplorer.Standalone.Mono\ + MONO,STANDALONE + UnityExplorer.STANDALONE.Mono + false + true + + + + v4.7.2 + ..\Release\UnityExplorer.Standalone.Il2Cpp\ + CPP,STANDALONE + UnityExplorer.STANDALONE.IL2CPP + true + true + + + + ..\Release\UnityExplorer.MelonLoader_Legacy.Il2Cpp\ + CPP,ML,ML_LEGACY + v4.7.2 + UnityExplorer.MLLEGACY.IL2CPP + true + true + + + + ..\Release\UnityExplorer.MelonLoader_Legacy.Mono\ + MONO,ML,ML_LEGACY + v3.5 + UnityExplorer.MLLEGACY.Mono + false + true + + + + + + + + + + + ..\lib\mcs-unity\mcs\bin\Release\mcs.dll + False + + + packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll + False + + + + + + ..\lib\MelonLoader\MelonLoader.dll + False + + + + + + ..\lib\MelonLoader_Legacy\MelonLoader.dll + False + + + + + + ..\lib\HarmonyX\Harmony\bin\Release\net35\0Harmony.dll + False + + + + + + ..\lib\BepInEx.5\BepInEx.dll + False + + + + + + ..\lib\BepInEx.6.Mono\BepInEx.Core.dll + False + + + ..\lib\BepInEx.6.Mono\BepInEx.Unity.dll + False + + + + + + ..\lib\BepInEx.6.IL2CPP\BepInEx.Core.dll + False + + + ..\lib\BepInEx.6.IL2CPP\BepInEx.IL2CPP.dll + False + + + + + + ..\lib\HarmonyX\Harmony\bin\Release\net35\0Harmony.dll + False + + + + + + ..\lib\mono\UnityEngine.dll + False + + + ..\lib\mono\UnityEngine.UI.dll + False + + + + + + ..\lib\Il2CppAssemblyUnhollower\UnhollowerBaseLib\bin\Release\net4.7.2\UnhollowerBaseLib.dll + False + + + ..\lib\unhollowed\Il2Cppmscorlib.dll + False + + + ..\lib\unhollowed\Il2CppSystem.Core.dll + False + + + ..\lib\unhollowed\UnityEngine.dll + False + + + ..\lib\unhollowed\UnityEngine.CoreModule.dll + False + + + ..\lib\unhollowed\UnityEngine.PhysicsModule.dll + False + + + ..\lib\unhollowed\UnityEngine.TextRenderingModule.dll + False + + + ..\lib\unhollowed\UnityEngine.UI.dll + False + + + ..\lib\unhollowed\UnityEngine.UIModule.dll + False + + + ..\lib\unhollowed\UnityEngine.IMGUIModule.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Release_ML_Cpp - AnyCPU - {B21DBDE3-5D6F-4726-93AB-CC3CC68BAE7D} - Library - Properties - 512 - true - - - - false - false - false - false - false - none - false - prompt - 4 - x64 - false - UnityExplorer - - - true + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - v4.7.2 - ..\Release\UnityExplorer.MelonLoader.Il2Cpp\ - CPP,ML - UnityExplorer.ML.IL2CPP - true - true - - - - v3.5 - ..\Release\UnityExplorer.MelonLoader.Mono\ - MONO,ML - UnityExplorer.ML.Mono - false - false - true - - - - v4.7.2 - ..\Release\UnityExplorer.BepInEx.Il2Cpp\ - CPP,BIE,BIE6 - UnityExplorer.BIE.IL2CPP - true - true - - - - v3.5 - ..\Release\UnityExplorer.BepInEx6.Mono\ - MONO,BIE,BIE6 - UnityExplorer.BIE6.Mono - false - true - - - - v3.5 - ..\Release\UnityExplorer.BepInEx5.Mono\ - MONO,BIE,BIE5 - UnityExplorer.BIE5.Mono - false - true - - - - v3.5 - ..\Release\UnityExplorer.Standalone.Mono\ - MONO,STANDALONE - UnityExplorer.STANDALONE.Mono - false - true - - - - v4.7.2 - ..\Release\UnityExplorer.Standalone.Il2Cpp\ - CPP,STANDALONE - UnityExplorer.STANDALONE.IL2CPP - true - true - - - - ..\Release\UnityExplorer.MelonLoader_Legacy.Il2Cpp\ - CPP,ML,ML_LEGACY - v4.7.2 - UnityExplorer.MLLEGACY.IL2CPP - true - true - - - - ..\Release\UnityExplorer.MelonLoader_Legacy.Mono\ - MONO,ML,ML_LEGACY - v3.5 - UnityExplorer.MLLEGACY.Mono - false - true - - - - - - - - - - - ..\lib\mcs-unity\mcs\bin\Release\mcs.dll - False - - - packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll - False - - - - - - ..\lib\MelonLoader\MelonLoader.dll - False - - - - - - ..\lib\MelonLoader_Legacy\MelonLoader.dll - False - - - - - - ..\lib\HarmonyX\Harmony\bin\Release\net35\0Harmony.dll - False - - - - - - ..\lib\BepInEx.5\BepInEx.dll - False - - - - - - ..\lib\BepInEx.6.Mono\BepInEx.Core.dll - False - - - ..\lib\BepInEx.6.Mono\BepInEx.Unity.dll - False - - - - - - ..\lib\BepInEx.6.IL2CPP\BepInEx.Core.dll - False - - - ..\lib\BepInEx.6.IL2CPP\BepInEx.IL2CPP.dll - False - - - - - - ..\lib\HarmonyX\Harmony\bin\Release\net35\0Harmony.dll - False - - - - - - ..\lib\mono\UnityEngine.dll - False - - - ..\lib\mono\UnityEngine.UI.dll - False - - - - - - ..\lib\Il2CppAssemblyUnhollower\UnhollowerBaseLib\bin\Release\net4.7.2\UnhollowerBaseLib.dll - False - - - ..\lib\unhollowed\Il2Cppmscorlib.dll - False - - - ..\lib\unhollowed\Il2CppSystem.Core.dll - False - - - ..\lib\unhollowed\UnityEngine.dll - False - - - ..\lib\unhollowed\UnityEngine.CoreModule.dll - False - - - ..\lib\unhollowed\UnityEngine.PhysicsModule.dll - False - - - ..\lib\unhollowed\UnityEngine.TextRenderingModule.dll - False - - - ..\lib\unhollowed\UnityEngine.UI.dll - False - - - ..\lib\unhollowed\UnityEngine.UIModule.dll - False - - - ..\lib\unhollowed\UnityEngine.IMGUIModule.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + \ No newline at end of file diff --git a/src/UnityExplorer.sln b/src/UnityExplorer.sln index eb7c9d7..7cb3391 100644 --- a/src/UnityExplorer.sln +++ b/src/UnityExplorer.sln @@ -34,10 +34,10 @@ Global {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU - {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release_MLLegacy_Cpp|Any CPU - {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release_MLLegacy_Cpp|Any CPU - {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release_MLLegacy_Mono|Any CPU - {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release_MLLegacy_Mono|Any CPU + {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release|Any CPU + {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release|Any CPU + {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release|Any CPU + {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release|Any CPU {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU {F2D7872C-5D4D-49EB-A656-C3D496DB4204}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU @@ -52,10 +52,10 @@ Global {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU - {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release_MLLegacy_Cpp|Any CPU - {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release_MLLegacy_Cpp|Any CPU - {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release_MLLegacy_Mono|Any CPU - {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release_MLLegacy_Mono|Any CPU + {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release|Any CPU + {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release|Any CPU + {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release|Any CPU + {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release|Any CPU {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU {7B7E5024-385D-4A46-9196-A6AF8F7FBDD5}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU @@ -70,10 +70,10 @@ Global {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Cpp|Any CPU.Build.0 = Release|Any CPU {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Mono|Any CPU.ActiveCfg = Release|Any CPU {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_ML_Mono|Any CPU.Build.0 = Release|Any CPU - {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release_MLLegacy_Cpp|x64 - {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release_MLLegacy_Cpp|x64 - {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release_MLLegacy_Mono|x64 - {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release_MLLegacy_Mono|x64 + {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Cpp|Any CPU.ActiveCfg = Release|Any CPU + {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Cpp|Any CPU.Build.0 = Release|Any CPU + {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Mono|Any CPU.ActiveCfg = Release|Any CPU + {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_MLLegacy_Mono|Any CPU.Build.0 = Release|Any CPU {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Cpp|Any CPU.ActiveCfg = Release|Any CPU {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Cpp|Any CPU.Build.0 = Release|Any CPU {E4989E4C-0875-4528-9031-08E2C0E70103}.Release_STANDALONE_Mono|Any CPU.ActiveCfg = Release|Any CPU