mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 22:07:48 +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.Text;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.EventSystems;
|
||||
using MelonLoader;
|
||||
|
||||
namespace Explorer
|
||||
|
@ -8,7 +8,6 @@ using UnhollowerBaseLib;
|
||||
using UnhollowerRuntimeLib;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace Explorer
|
||||
{
|
||||
|
@ -20,27 +20,35 @@ namespace Explorer
|
||||
public static bool ScrollFailed = false;
|
||||
public static bool ManualUnstripFailed = false;
|
||||
|
||||
private static GenericStack ScrollStack
|
||||
{
|
||||
get
|
||||
private static GenericStack ScrollStack => m_scrollStack ?? GetScrollStack();
|
||||
private static PropertyInfo m_scrollViewStatesInfo;
|
||||
private static GenericStack m_scrollStack;
|
||||
|
||||
private static GenericStack GetScrollStack()
|
||||
{
|
||||
if (m_scrollViewStatesInfo == null)
|
||||
{
|
||||
try
|
||||
if (typeof(GUI).GetProperty("scrollViewStates", ReflectionHelpers.CommonFlags) is PropertyInfo scrollStatesInfo)
|
||||
{
|
||||
m_scrollViewStatesInfo = typeof(GUI).GetProperty("scrollViewStates");
|
||||
if (m_scrollViewStatesInfo == null) throw new Exception();
|
||||
m_scrollViewStatesInfo = scrollStatesInfo;
|
||||
}
|
||||
catch
|
||||
else if (typeof(GUI).GetProperty("s_ScrollViewStates", ReflectionHelpers.CommonFlags) is PropertyInfo s_scrollStatesInfo)
|
||||
{
|
||||
m_scrollViewStatesInfo = typeof(GUI).GetProperty("s_scrollViewStates");
|
||||
m_scrollViewStatesInfo = s_scrollStatesInfo;
|
||||
}
|
||||
}
|
||||
|
||||
return (GenericStack)m_scrollViewStatesInfo?.GetValue(null, null);
|
||||
if (m_scrollViewStatesInfo?.GetValue(null, null) is GenericStack stack)
|
||||
{
|
||||
m_scrollStack = stack;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_scrollStack = new GenericStack();
|
||||
}
|
||||
|
||||
return m_scrollStack;
|
||||
}
|
||||
private static PropertyInfo m_scrollViewStatesInfo;
|
||||
|
||||
public static void Space(float pixels)
|
||||
{
|
||||
@ -145,7 +153,7 @@ namespace Explorer
|
||||
private static Vector2 BeginScrollView_Impl(Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal,
|
||||
bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background)
|
||||
{
|
||||
GUIUtility.CheckOnGUI();
|
||||
// GUIUtility.CheckOnGUI();
|
||||
|
||||
int controlID = GUIUtility.GetControlID(GUI.s_ScrollviewHash, FocusType.Passive);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user