Esempio n. 1
0
        public static void CustomSelectListCtrlHook(ChaCustom.CustomSelectListCtrl __instance)
        {
            var objContent = (GameObject)AccessTools.Field(typeof(ChaCustom.CustomSelectListCtrl), "objContent").GetValue(__instance);

            foreach (Transform t in objContent.transform)
            {
                var go   = t.gameObject;
                var csic = go.GetComponent <ChaCustom.CustomSelectInfoComponent>();
                if (!csic)
                {
                    continue;
                }
                var image = csic.img;
                if (image == null)
                {
                    return;
                }
                var path  = GameObjectUtils.AbsoluteTransform(go);
                var scene = go.scene.name;

                var mt = csic?.img?.mainTexture;
                if (mt)
                {
                    if (mt.name.StartsWith("*"))
                    {
                        mt.name = mt.name.Substring(1);
                    }
                }
                ImageTranslator.TranslateImage(csic.img, path, scene);
            }
        }
Esempio n. 2
0
        public static void LoadSpriteHook(ref UnityEngine.UI.Image image)
        {
            var go    = image.gameObject;
            var path  = GameObjectUtils.AbsoluteTransform(go);
            var scene = go.scene.name;

            ImageTranslator.TranslateImage(image, path, scene);
        }