Esempio n. 1
0
        static MethodBase TargetMethod(object instance)
        {
#if MANAGED
            return(AccessToolsShim.Method(UnityTypes.TMP_Text?.ClrType, "SetText", new[] { typeof(StringBuilder) }));
#else
            return(AccessToolsShim.Method(UnityTypes.TMP_Text?.ClrType, "SetText", new[] { typeof(Il2CppSystem.Text.StringBuilder) }));
#endif
        }
Esempio n. 2
0
        static MethodBase TargetMethod(object instance)
        {
#if MANAGED
            return(AccessToolsShim.Method(UnityTypes.TMP_Text?.ClrType, "SetCharArray", new[] { typeof(int[]), typeof(int), typeof(int) }));
#else
            return(AccessToolsShim.Method(UnityTypes.TMP_Text?.ClrType, "SetCharArray", new[] { typeof(UnhollowerBaseLib.Il2CppStructArray <int>), typeof(int), typeof(int) }));
#endif
        }
Esempio n. 3
0
        public static void SetAllDirtyEx(this object ui)
        {
            if (ui == null)
            {
                return;
            }

            var type = ui.GetType();

            if (ClrTypes.Graphic != null && ClrTypes.Graphic.IsAssignableFrom(type))
            {
                ClrTypes.Graphic.CachedMethod(SetAllDirtyMethodName).Invoke(ui);
            }
            else
            {
                AccessToolsShim.Method(type, MarkAsChangedMethodName)?.Invoke(ui, null);
            }
        }
Esempio n. 4
0
        public static void SetAllDirtyEx(this object ui)
        {
            if (ui == null)
            {
                return;
            }

            var type = ui.GetUnityType();

            if (UnityTypes.Graphic != null && UnityTypes.Graphic.IsAssignableFrom(type))
            {
                UnityTypes.Graphic.ClrType.CachedMethod(SetAllDirtyMethodName).Invoke(ui);
            }
            else if (!ui.TryCastTo <SpriteRenderer>(out _))
            {
                var clrType = ui.GetType();
                AccessToolsShim.Method(clrType, MarkAsChangedMethodName)?.Invoke(ui, null);
            }
        }
Esempio n. 5
0
        public static void SetAllDirtyEx(this object ui)
        {
            if (ui == null)
            {
                return;
            }

            if (ui is Graphic graphic)
            {
                graphic.SetAllDirty();
            }
            else
            {
                // lets attempt some reflection for several known types
                var type = ui.GetType();

                AccessToolsShim.Method(type, MarkAsChangedMethodName)?.Invoke(ui, null);
            }
        }
Esempio n. 6
0
        public void ResetScrollIn(object ui)
        {
            if (!_hasCheckedTypeWriter)
            {
                _hasCheckedTypeWriter = true;

                if (UnityTypes.Typewriter != null)
                {
                    var component = ui as Component;
                    if (ui != null && component.GetComponent(UnityTypes.Typewriter.UnityType).TryCastTo <MonoBehaviour>(out var typeWriter))
                    {
                        _typewriter = typeWriter;
                    }
                }
            }

            if (_typewriter != null)
            {
                AccessToolsShim.Method(UnityTypes.Typewriter.ClrType, "OnEnable")?.Invoke(_typewriter, null);
            }
        }
        public void ResetScrollIn(object graphic)
        {
            if (!_hasCheckedTypeWriter)
            {
                _hasCheckedTypeWriter = true;

                if (ClrTypes.Typewriter != null)
                {
                    var ui = graphic as Component;
                    if (ui != null)
                    {
                        _typewriter = (MonoBehaviour)ui.GetComponent(ClrTypes.Typewriter);
                    }
                }
            }

            if (_typewriter != null)
            {
                AccessToolsShim.Method(ClrTypes.Typewriter, "OnEnable")?.Invoke(_typewriter, null);
            }
        }
Esempio n. 8
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.GUI, "DoToggle", new[] { typeof(Rect), typeof(int), typeof(bool), typeof(GUIContent), typeof(GUIStyle) }));
 }
Esempio n. 9
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.GUI, "DoButtonGrid", new[] { typeof(Rect), typeof(int), typeof(GUIContent[]), typeof(string[]), typeof(int), typeof(GUIStyle), typeof(GUIStyle), typeof(GUIStyle), typeof(GUIStyle), ClrTypes.GUI_ToolbarButtonSize, typeof(bool[]) }));
 }
Esempio n. 10
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.GUI, "DoWindow", new[] { typeof(int), typeof(Rect), typeof(WindowFunction), typeof(GUIContent), typeof(GUIStyle), typeof(GUISkin), typeof(bool) }));
 }
Esempio n. 11
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.GUI, "DoButton", new[] { typeof(Rect), typeof(GUIContent), typeof(IntPtr) }));
 }
Esempio n. 12
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.GUI, "DoRepeatButton", new[] { typeof(Rect), typeof(GUIContent), typeof(GUIStyle), typeof(FocusType) }));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(AssetBundleCreateRequest), "SetEnableCompatibilityChecks", new[] { typeof(bool) }));
 }
 static bool Prepare(object instance)
 {
     return(AccessToolsShim.Method(typeof(Resources), "GetBuiltinResource", typeof(string), typeof(Type)) == null);
 }
Esempio n. 15
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.TextWindow, "SetText", new Type[] { typeof(string) }));
 }
Esempio n. 16
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.TMP_Text, "SetText", new[] { typeof(string), typeof(float), typeof(float), typeof(float) }));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(AssetBundle), "LoadAll", typeof(Type)));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(AssetBundle), "returnMainAsset", new[] { typeof(AssetBundle) }));
 }
        static bool Prepare(object instance)
        {
            var returnMainAsset = AccessToolsShim.Method(typeof(AssetBundle), "returnMainAsset", new[] { typeof(AssetBundle) });

            return(returnMainAsset != null);
        }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(AssetBundle), "LoadFromMemory_Internal", typeof(byte[]), typeof(uint))
            ?? AccessToolsShim.Method(typeof(AssetBundle), "LoadFromMemory", typeof(byte[]), typeof(uint)));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(AssetBundle), "LoadFromFile_Internal", typeof(string), typeof(uint), typeof(ulong))
            ?? AccessToolsShim.Method(typeof(AssetBundle), "LoadFromFile", typeof(string), typeof(uint), typeof(ulong)));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(Resources), "GetBuiltinResource", typeof(Type), typeof(string)));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(AssetBundleCreateRequest), "DisableCompatibilityChecks"));
 }
Esempio n. 24
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.GUI, "BeginGroup", new[] { typeof(Rect), typeof(GUIContent), typeof(GUIStyle), typeof(Vector2) }));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(AssetBundle), "LoadAssetWithSubAssetsAsync_Internal", typeof(string), typeof(Type)));
 }
        static bool Prepare(object instance)
        {
            var enableCompatChecks = AccessToolsShim.Method(typeof(AssetBundleCreateRequest), "SetEnableCompatibilityChecks", new[] { typeof(bool) });

            return(enableCompatChecks != null);
        }
Esempio n. 27
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.TMP_Text, "SetCharArray", new[] { typeof(int[]), typeof(int), typeof(int) }));
 }
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(typeof(Resources), "LoadAll", typeof(string), typeof(Type)));
 }
Esempio n. 29
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.TextMeshProUGUI, "OnEnable"));
 }
Esempio n. 30
0
 static MethodBase TargetMethod(object instance)
 {
     return(AccessToolsShim.Method(ClrTypes.UILabel, "OnEnable"));
 }