コード例 #1
0
ファイル: RageHUD.cs プロジェクト: ArcPh1r3/PaladinMod
        public void Update()
        {
            if (this.hud.targetBodyObject)
            {
                PaladinRageController rageComponent = this.hud.targetBodyObject.GetComponent <PaladinRageController>();
                if (rageComponent)
                {
                    PlayerCharacterMasterController masterController = this.hud.targetMaster ? this.hud.targetMaster.playerCharacterMasterController : null;

                    if (this.rageGauge)
                    {
                        this.rageGauge.gameObject.SetActive(true);

                        float _fillAmount   = rageComponent.currentRage / rageComponent.maxRage;
                        float oldFillAmount = this.rageFill.fillAmount;

                        this.FillGauge(_fillAmount);

                        this.rageFill.fillAmount = this.currentFill;

                        float r            = Mathf.Lerp(this.startColor.r, this.endColor.r, this.currentFill);
                        float g            = Mathf.Lerp(this.startColor.g, this.endColor.g, this.currentFill);
                        float b            = Mathf.Lerp(this.startColor.b, this.endColor.b, this.currentFill);
                        Color desiredColor = new Color(r, g, b);
                        if (this.currentFill >= 1f)
                        {
                            desiredColor = Color.red;
                        }

                        this.rageFill.color = desiredColor;
                    }
                }
                else
                {
                    if (this.rageGauge)
                    {
                        this.rageGauge.gameObject.SetActive(false);
                    }
                }
            }
        }
コード例 #2
0
        private static bool HasSufficientRage([NotNull] GenericSkill skillSlot)
        {
            PaladinRageController rageComponent = ((PaladinRageSkillDef.InstanceData)skillSlot.skillInstanceData).rageComponent;

            return((rageComponent != null) ? (rageComponent.currentRage >= skillSlot.rechargeStock) : false);
        }