mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-17 06:28:42 +08:00
Fix FPS drop with MelonLoader
This commit is contained in:
parent
0050cff185
commit
0dd19345ed
@ -16,7 +16,7 @@ namespace UnityExplorer
|
|||||||
public static class ExplorerCore
|
public static class ExplorerCore
|
||||||
{
|
{
|
||||||
public const string NAME = "UnityExplorer";
|
public const string NAME = "UnityExplorer";
|
||||||
public const string VERSION = "4.4.1";
|
public const string VERSION = "4.4.2";
|
||||||
public const string AUTHOR = "Sinai";
|
public const string AUTHOR = "Sinai";
|
||||||
public const string GUID = "com.sinai.unityexplorer";
|
public const string GUID = "com.sinai.unityexplorer";
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ using UnityExplorer.UI.Panels;
|
|||||||
using UnityExplorer.UI.Widgets;
|
using UnityExplorer.UI.Widgets;
|
||||||
using UniverseLib.UI;
|
using UniverseLib.UI;
|
||||||
using UniverseLib;
|
using UniverseLib;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
namespace UnityExplorer.ObjectExplorer
|
namespace UnityExplorer.ObjectExplorer
|
||||||
{
|
{
|
||||||
@ -254,6 +255,21 @@ namespace UnityExplorer.ObjectExplorer
|
|||||||
// Scene Loader
|
// Scene Loader
|
||||||
|
|
||||||
ConstructSceneLoader();
|
ConstructSceneLoader();
|
||||||
|
|
||||||
|
RuntimeProvider.Instance.StartCoroutine(TempFixCoro());
|
||||||
|
}
|
||||||
|
|
||||||
|
// To "fix" a strange FPS drop issue with MelonLoader.
|
||||||
|
private IEnumerator TempFixCoro()
|
||||||
|
{
|
||||||
|
float start = Time.realtimeSinceStartup;
|
||||||
|
|
||||||
|
while (Time.realtimeSinceStartup - start < 2.5f)
|
||||||
|
yield return null;
|
||||||
|
|
||||||
|
// Select "HideAndDontSave" and then go back to first scene.
|
||||||
|
this.sceneDropdown.value = sceneDropdown.options.Count - 1;
|
||||||
|
this.sceneDropdown.value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string DEFAULT_LOAD_TEXT = "[Select a scene]";
|
private const string DEFAULT_LOAD_TEXT = "[Select a scene]";
|
||||||
|
@ -133,10 +133,11 @@ namespace UnityExplorer.ObjectExplorer
|
|||||||
LoadedScenes.Add(scene);
|
LoadedScenes.Add(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool anyChange = confirmedCount != LoadedScenes.Count;
|
|
||||||
|
|
||||||
LoadedScenes.Add(DontDestroyScene);
|
LoadedScenes.Add(DontDestroyScene);
|
||||||
LoadedScenes.Add(default);
|
LoadedScenes.Add(default);
|
||||||
|
|
||||||
|
bool anyChange = confirmedCount != LoadedScenes.Count;
|
||||||
|
|
||||||
previousLoadedScenes = new HashSet<Scene>(LoadedScenes);
|
previousLoadedScenes = new HashSet<Scene>(LoadedScenes);
|
||||||
|
|
||||||
// Default to first scene if none selected or previous selection no longer exists.
|
// Default to first scene if none selected or previous selection no longer exists.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user