public static void Init() { MethodInfo from = typeof(UIScrollbar).GetMethod("AutoDisableButtons", BindingFlags.NonPublic | BindingFlags.Instance); MethodInfo to = typeof(UIScrollbarFix).GetMethod("AutoDisableButtons", BindingFlags.NonPublic | BindingFlags.Instance); RedirectionHelper.RedirectCalls(from, to); }
private static void Bootstrap() { RedirectionHelper.RedirectCalls( typeof(LoadingWrapper).GetMethod("OnLoadingExtensionsCreated", BindingFlags.Instance | BindingFlags.NonPublic), typeof(IsolatedFailures).GetMethod("OnLoadingExtensionsCreated", BindingFlags.Instance | BindingFlags.NonPublic)); if (FindType("ModTools") == null) { RedirectionHelper.RedirectCalls( typeof(LoadingWrapper).GetMethod("OnLevelLoaded", BindingFlags.Instance | BindingFlags.Public), typeof(IsolatedFailures).GetMethod("OnLevelLoaded", BindingFlags.Instance | BindingFlags.Public)); } else { UnityEngine.Debug.LogWarning("IsolatedFailures#Bootstrap(): ModTools discovered"); } RedirectionHelper.RedirectCalls( typeof(LoadingWrapper).GetMethod("OnLevelUnloading", BindingFlags.Instance | BindingFlags.Public), typeof(IsolatedFailures).GetMethod("OnLevelUnloading", BindingFlags.Instance | BindingFlags.Public)); RedirectionHelper.RedirectCalls( typeof(LoadingWrapper).GetMethod("OnLoadingExtensionsReleased", BindingFlags.Instance | BindingFlags.NonPublic), typeof(IsolatedFailures).GetMethod("OnLoadingExtensionsReleased", BindingFlags.Instance | BindingFlags.NonPublic)); }