1
0
mirror of https://github.com/originalnicodr/CinematicUnityExplorer.git synced 2026-10-10 13:03:15 +08:00

Improved compatibility for IL2CPP games for disabling cinemachine, finding postprocessing objects, and more.

This commit is contained in:
originalnicodr
2024-02-08 19:37:09 -03:00
parent bfdeaacf33
commit 47e6e3cda8
5 changed files with 24 additions and 7 deletions
+11 -3
View File
@@ -103,7 +103,7 @@ namespace UnityExplorer
// Continous checks and actions
stopFrameSkip();
maybeForcePause();
UIManager.GetPanel<UnityExplorer.UI.Panels.Misc>(UIManager.Panels.Misc).MaybeTakeScreenshot();
maybeTakeScreenshot();
if (IInputManager.GetKeyDown(ConfigManager.Pause.Value))
{
@@ -154,8 +154,16 @@ namespace UnityExplorer
void maybeForcePause(){
// Force pause no matter the game timescale changes
if (UIManager.GetTimeScaleWidget().IsPaused() && Time.timeScale != 0) {
UIManager.GetTimeScaleWidget().SetTimeScale(0f);
TimeScaleWidget timescale = UIManager.GetTimeScaleWidget();
if (timescale != null && timescale.IsPaused() && Time.timeScale != 0) {
timescale.SetTimeScale(0f);
}
}
void maybeTakeScreenshot(){
UnityExplorer.UI.Panels.Misc miscPanel = UIManager.GetPanel<UnityExplorer.UI.Panels.Misc>(UIManager.Panels.Misc);
if (miscPanel != null){
miscPanel.MaybeTakeScreenshot();
}
}
}
+2 -1
View File
@@ -58,7 +58,6 @@ namespace UnityExplorer
UnityCrashPrevention.Init();
//Extra inits
KeypressListener.Setup();
ArrowGenerator.PatchLights();
}
@@ -78,6 +77,8 @@ namespace UnityExplorer
IInputManager.Setup();
// InspectorManager.Inspect(typeof(Tests.TestClass));
KeypressListener.Setup();
}
internal static void Update()
+1 -1
View File
@@ -200,7 +200,7 @@ namespace UnityExplorer.UI.Panels
IEnumerable<Behaviour> comps = ourCamera.GetComponentsInChildren<Behaviour>();
foreach (Behaviour comp in comps)
{
if (comp.GetType().ToString() == "Cinemachine.CinemachineBrain"){
if (comp.GetActualType().ToString() == "Cinemachine.CinemachineBrain"){
comp.enabled = enable;
disabledCinemachine = !enable;
break;
+1
View File
@@ -157,6 +157,7 @@ namespace UnityExplorer.UI.Panels
List<Renderer> renderers = RuntimeHelper.FindObjectsOfTypeAll(typeof(Renderer))
.Select(obj => obj.TryCast<Renderer>())
.Where(r => r.isVisible && r.enabled)
.ToList();
foreach (Renderer renderer in renderers){
+9 -2
View File
@@ -94,7 +94,11 @@ namespace UnityExplorer.UI.Panels
};
foreach (string effect in universalClassEffects){
AddEffect("UnityEngine.Rendering.Universal", effect);
try {
AddEffect("UnityEngine.Rendering.Universal", effect);
}
catch {}
}
string[] postProcessingClassEffects = {
@@ -112,7 +116,10 @@ namespace UnityExplorer.UI.Panels
};
foreach (string effect in postProcessingClassEffects){
AddEffect("UnityEngine.Rendering.PostProcessing", effect);
try {
AddEffect("UnityEngine.Rendering.PostProcessing", effect);
}
catch {}
}
BuildEffectTogglers();