Esempio n. 1
0
        public static bool SetCursorHook(ref Texture2D texture)
        {
            var scene = "Cursors";

            ImageTranslator.RegisterTexture(texture, string.Empty, scene);
            ImageTranslator.ReplaceTexture(texture, string.Empty, scene);
            return(true);
        }
Esempio n. 2
0
        public static void DoSpriteSwapHook(ref Selectable __instance, ref Sprite newSprite)
        {
            if (newSprite == null)
            {
                newSprite = __instance.image.sprite;
            }
            var go    = __instance.gameObject;
            var path  = GameObjectUtils.AbsoluteTransform(go);
            var scene = go.scene.name;

            ImageTranslator.RegisterTexture(newSprite, path, scene);
            ImageTranslator.ReplaceTexture(ref newSprite, path, scene);
        }
Esempio n. 3
0
        public static void ActionChangeUISetHook(ref ActionChangeUI __instance)
        {
            var image = (UnityEngine.UI.Image)AccessTools.Field(typeof(ActionChangeUI), "target").GetValue(__instance);

            if (image == null)
            {
                return;
            }
            var go    = __instance.gameObject;
            var path  = GameObjectUtils.AbsoluteTransform(go);
            var scene = go.scene.name;

            ImageTranslator.RegisterTexture(image, path, scene);
            ImageTranslator.ReplaceTexture(image, path, scene);
        }