mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 06:08:16 +08:00
Fix scroll not working in 2017 games
This commit is contained in:
parent
eff8d63c81
commit
2d7dfa53eb
BIN
lib/mcs.NET35.dll
Normal file
BIN
lib/mcs.NET35.dll
Normal file
Binary file not shown.
@ -3,8 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
|
||||||
using UnityEngine.EventSystems;
|
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
|
|
||||||
namespace Explorer
|
namespace Explorer
|
||||||
|
@ -8,7 +8,6 @@ using UnhollowerBaseLib;
|
|||||||
using UnhollowerRuntimeLib;
|
using UnhollowerRuntimeLib;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
using UnityEngine.EventSystems;
|
|
||||||
|
|
||||||
namespace Explorer
|
namespace Explorer
|
||||||
{
|
{
|
||||||
|
@ -20,28 +20,36 @@ namespace Explorer
|
|||||||
public static bool ScrollFailed = false;
|
public static bool ScrollFailed = false;
|
||||||
public static bool ManualUnstripFailed = false;
|
public static bool ManualUnstripFailed = false;
|
||||||
|
|
||||||
private static GenericStack ScrollStack
|
private static GenericStack ScrollStack => m_scrollStack ?? GetScrollStack();
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (m_scrollViewStatesInfo == null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_scrollViewStatesInfo = typeof(GUI).GetProperty("scrollViewStates");
|
|
||||||
if (m_scrollViewStatesInfo == null) throw new Exception();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
m_scrollViewStatesInfo = typeof(GUI).GetProperty("s_scrollViewStates");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (GenericStack)m_scrollViewStatesInfo?.GetValue(null, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private static PropertyInfo m_scrollViewStatesInfo;
|
private static PropertyInfo m_scrollViewStatesInfo;
|
||||||
|
private static GenericStack m_scrollStack;
|
||||||
|
|
||||||
|
private static GenericStack GetScrollStack()
|
||||||
|
{
|
||||||
|
if (m_scrollViewStatesInfo == null)
|
||||||
|
{
|
||||||
|
if (typeof(GUI).GetProperty("scrollViewStates", ReflectionHelpers.CommonFlags) is PropertyInfo scrollStatesInfo)
|
||||||
|
{
|
||||||
|
m_scrollViewStatesInfo = scrollStatesInfo;
|
||||||
|
}
|
||||||
|
else if (typeof(GUI).GetProperty("s_ScrollViewStates", ReflectionHelpers.CommonFlags) is PropertyInfo s_scrollStatesInfo)
|
||||||
|
{
|
||||||
|
m_scrollViewStatesInfo = s_scrollStatesInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_scrollViewStatesInfo?.GetValue(null, null) is GenericStack stack)
|
||||||
|
{
|
||||||
|
m_scrollStack = stack;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_scrollStack = new GenericStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_scrollStack;
|
||||||
|
}
|
||||||
|
|
||||||
public static void Space(float pixels)
|
public static void Space(float pixels)
|
||||||
{
|
{
|
||||||
GUIUtility.CheckOnGUI();
|
GUIUtility.CheckOnGUI();
|
||||||
@ -145,7 +153,7 @@ namespace Explorer
|
|||||||
private static Vector2 BeginScrollView_Impl(Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal,
|
private static Vector2 BeginScrollView_Impl(Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal,
|
||||||
bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background)
|
bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background)
|
||||||
{
|
{
|
||||||
GUIUtility.CheckOnGUI();
|
// GUIUtility.CheckOnGUI();
|
||||||
|
|
||||||
int controlID = GUIUtility.GetControlID(GUI.s_ScrollviewHash, FocusType.Passive);
|
int controlID = GUIUtility.GetControlID(GUI.s_ScrollviewHash, FocusType.Passive);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user