コード例 #1
0
        private static void OnSprintStart(On.RoR2.CharacterBody.orig_OnSprintStart orig, CharacterBody self)
        {
            if (self.IsLocalBody())
            {
                if (!cachedSprintIcon)
                {
                    Transform iconTransform = Utils.localCameraRig.hud.mainUIPanel.transform.Find("SpringCanvas/BottomRightCluster/Scaler/SprintCluster/SprintIcon");
                    if (iconTransform)
                    {
                        Image sprintIcon = iconTransform.GetComponent <Image>();

                        if (sprintIcon)
                        {
                            cachedSprintIcon = sprintIcon;
                        }
                    }
                }

                if (cachedSprintIcon)
                {
                    originalSprintIconColor = cachedSprintIcon.color;

                    cachedSprintIcon.color = Color.yellow;
                }

                if (self.name.Contains("Bandit2"))
                {
                    GetHandByDominance(true).animator.SetBool("IsSprinting", true);
                }
            }

            orig(self);
        }
コード例 #2
0
        private static void OnSprintStop(On.RoR2.CharacterBody.orig_OnSprintStop orig, CharacterBody self)
        {
            if (self.IsLocalBody())
            {
                if (cachedSprintIcon)
                {
                    cachedSprintIcon.color = originalSprintIconColor;
                }

                if (self.name.Contains("Bandit2"))
                {
                    GetHandByDominance(true).animator.SetBool("IsSprinting", false);
                }
            }

            orig(self);
        }