FairyGUI.GSlider.UpdateWidthPercent C# (CSharp) Method

UpdateWidthPercent() private method

private UpdateWidthPercent ( float percent ) : void
percent float
return void
        private void UpdateWidthPercent(float percent)
        {
            if (_titleObject != null)
            {
                switch (_titleType)
                {
                    case ProgressTitleType.Percent:
                        _titleObject.text = Mathf.RoundToInt(percent * 100) + "%";
                        break;

                    case ProgressTitleType.ValueAndMax:
                        _titleObject.text = Mathf.RoundToInt(_value) + "/" + Mathf.RoundToInt(max);
                        break;

                    case ProgressTitleType.Value:
                        _titleObject.text = "" + Mathf.RoundToInt(_value);
                        break;

                    case ProgressTitleType.Max:
                        _titleObject.text = "" + Mathf.RoundToInt(_max);
                        break;
                }
            }

            if (_barObjectH != null)
                _barObjectH.width = Mathf.RoundToInt((this.width - _barMaxWidthDelta) * percent);
            if (_barObjectV != null)
                _barObjectV.height = Mathf.RoundToInt((this.height - _barMaxHeightDelta) * percent);
            if (_aniObject != null)
                _aniObject.frame = Mathf.RoundToInt(percent * 100);

            this.InvalidateBatchingState();
        }