Beispiel #1
0
 public static void AwakePostfix(MPCharCtrl __instance)
 {
     ((Button)__instance.GetField("ikInfo").GetField("buttonReflectFK")).onClick.RemoveAllListeners();
     ((Button)__instance.GetField("ikInfo").GetField("buttonReflectFK")).onClick.AddListener(delegate() {
         //__instance.CopyBoneFK((OIBoneInfo.BoneGroup)353);
         __instance.Invoke("CopyBoneFK", new object[] { OIBoneInfo.BoneGroup.Body });
     });
     ((Button[])__instance.GetField("fkInfo").GetField("buttonAnimeSingle"))[1].onClick.RemoveAllListeners();
     ((Button[])__instance.GetField("fkInfo").GetField("buttonAnimeSingle"))[1].onClick.AddListener(delegate() {
         __instance.Invoke("CopyBoneFK", new object[] { OIBoneInfo.BoneGroup.Neck });
     });
     KK_StudioReflectFKFix.Logger.LogDebug("FK Fix Finish");
     InitBtn(__instance);
 }
Beispiel #2
0
        private static void InitBtn(MPCharCtrl __instance)
        {
            var original = GameObject.Find("StudioScene/Canvas Main Menu/01_Add/00_Female/Button Change");
            var parent   = GameObject.Find("StudioScene/Canvas Main Menu/02_Manipulate/00_Chara/02_Kinematic/03_Neck");

            btn      = UnityEngine.Object.Instantiate(original, parent.transform);
            btn.name = "Copy FK Neck";
            btn.transform.localPosition = new Vector3(0, -95, 0);
            btn.transform.SetRect(new Vector2(0, 1), new Vector2(0, 1), new Vector2(0, -116), new Vector2(190, -95));
            btn.GetComponent <Image>().sprite = Extension.Extension.LoadNewSprite("KK_StudioReflectFKFix.Resources.CopyFKNeck.png", 183, 20);
            btn.GetComponent <Button>().onClick.RemoveAllListeners();
            btn.GetComponent <Button>().onClick.SetPersistentListenerState(0, UnityEngine.Events.UnityEventCallState.Off);
            btn.GetComponent <Button>().interactable = true;

            btn.GetComponent <Button>().onClick.AddListener(() => {
                __instance.Invoke("CopyBoneFK", new object[] { OIBoneInfo.BoneGroup.Neck });
            });

            KK_StudioReflectFKFix.Logger.LogDebug("Draw Button Finish");
        }