Exemple #1
0
        public void RefreshExperienceBar(Player owningPlayer, UpdateType updateType, bool isLevelUp)
        {
            if (updateType == UpdateType.Instant)
            {
                XPGauge.Height  = xpGaugeMax * owningPlayer.ProgressToNextLevel;
                WeaponLevelText = $"{owningPlayer.CurrentWeaponLevel + 1}";
            }
            else
            {
                // in case we switched weapons
                if (isLevelUp)
                {
                    // go back toi 0
                    WeaponLevelText = $"{owningPlayer.CurrentWeaponLevel}";
                }

                BarController.InterpolateToRatio(owningPlayer.ProgressToNextLevel, isLevelUp);

                CurrentScreen.Call(() =>
                {
                    if (isLevelUp)
                    {
                        this.TextGrowAndShrinkAnimation.Play();
                    }

                    WeaponLevelText = $"{owningPlayer.CurrentWeaponLevel + 1}";
                }).After(1);
            }
        }