private static void KillDiagonals(On.HeroController.orig_HeroDash orig, HeroController self)
        {
            InputHandler input = ReflectionHelper.GetAttr <HeroController, InputHandler>(HeroController.instance, "inputHandler");

            if (input.inputActions.left.IsPressed || input.inputActions.right.IsPressed)
            {
                ref bool down_enabled = ref Mirror.GetFieldRef <OneAxisInputControl, bool>(input.inputActions.down, "Enabled");

                bool orig_enabled = down_enabled;

                down_enabled = false;

                orig(self);

                down_enabled = orig_enabled;
            }
Ejemplo n.º 2
0
        private static void KillDiagonals(On.HeroController.orig_HeroDash orig, HeroController self)
        {
            InputHandler input = ReflectionHelper.GetAttr <HeroController, InputHandler>(HeroController.instance, "inputHandler");

            if (input.inputActions.left.IsPressed || input.inputActions.right.IsPressed)
            {
                bool downEnabled = ReflectionHelper.GetAttr <OneAxisInputControl, bool>(input.inputActions.down, "Enabled");

                ReflectionHelper.SetAttr(input.inputActions.down, "Enabled", false);

                orig(self);

                ReflectionHelper.SetAttr(input.inputActions.down, "Enabled", downEnabled);
            }
            else
            {
                orig(self);
            }
        }
Ejemplo n.º 3
0
        private static void OnNextChar(On.DialogueBox.orig_ShowNextChar orig, DialogueBox self)
        {
            TextMeshPro text = ReflectionHelper.GetAttr <DialogueBox, TextMeshPro>(self, "textMesh");

            text.maxVisibleCharacters = text.textInfo.pageInfo[self.currentPage - 1].lastCharacterIndex + 1;
        }
Ejemplo n.º 4
0
 private static string GetSavePath(int saveSlot, string ending)
 {
     return(Path.Combine(ReflectionHelper.GetAttr <DesktopPlatform, string>(Platform.Current as DesktopPlatform, "saveDirPath"), $"user{saveSlot}.{ending}"));
 }
Ejemplo n.º 5
0
 public static T GetAttr <T>(this object obj, string name, bool instance = true) =>
 ReflectionHelper.GetAttr <T>(obj, name, instance);