private void renderProgressFill() { if (this.Atlas == null) { return; } dfAtlas.ItemInfo item = this.Atlas[this.progressSprite]; if (item == null) { return; } Vector3 vector3 = new Vector3((float)this.padding.left, (float)(-this.padding.top)); Vector2 vector2 = new Vector2(this.size.x - (float)this.padding.horizontal, this.size.y - (float)this.padding.vertical); float single = 1f; float single1 = this.maxValue - this.minValue; float single2 = (this.rawValue - this.minValue) / single1; dfProgressFillMode _dfProgressFillMode = this.fillMode; if (_dfProgressFillMode == dfProgressFillMode.Stretch) { vector2.x *single2 >= (float)item.border.horizontal; } if (_dfProgressFillMode != dfProgressFillMode.Fill) { vector2.x = Mathf.Max((float)item.border.horizontal, vector2.x * single2); } else { single = single2; } Color32 color32 = base.ApplyOpacity((!base.IsEnabled ? base.DisabledColor : this.ProgressColor)); dfSprite.RenderOptions renderOption = new dfSprite.RenderOptions(); dfSprite.RenderOptions upperLeft = renderOption; upperLeft.atlas = this.atlas; upperLeft.color = color32; upperLeft.fillAmount = single; upperLeft.offset = this.pivot.TransformToUpperLeft(base.Size) + vector3; upperLeft.pixelsToUnits = base.PixelsToUnits(); upperLeft.size = vector2; upperLeft.spriteInfo = item; renderOption = upperLeft; if (item.border.horizontal != 0 || item.border.vertical != 0) { dfSlicedSprite.renderSprite(this.renderData, renderOption); } else { dfSprite.renderSprite(this.renderData, renderOption); } }
private void renderProgressFill() { if (this.Atlas != null) { dfAtlas.ItemInfo info = this.Atlas[this.progressSprite]; if (info != null) { Vector3 vector = new Vector3((float)this.padding.left, (float)-this.padding.top); Vector2 vector2 = new Vector2(this.size.x - this.padding.horizontal, this.size.y - this.padding.vertical); float num = 1f; float num2 = this.maxValue - this.minValue; float num3 = (this.rawValue - this.minValue) / num2; dfProgressFillMode fillMode = this.fillMode; if ((fillMode == dfProgressFillMode.Stretch) && ((vector2.x * num3) < info.border.horizontal)) { } if (fillMode == dfProgressFillMode.Fill) { num = num3; } else { vector2.x = Mathf.Max((float)info.border.horizontal, vector2.x * num3); } Color32 color = base.ApplyOpacity(!base.IsEnabled ? base.DisabledColor : this.ProgressColor); dfSprite.RenderOptions options = new dfSprite.RenderOptions { atlas = this.atlas, color = color, fillAmount = num, offset = base.pivot.TransformToUpperLeft(base.Size) + vector, pixelsToUnits = base.PixelsToUnits(), size = vector2, spriteInfo = info }; if ((info.border.horizontal == 0) && (info.border.vertical == 0)) { dfSprite.renderSprite(base.renderData, options); } else { dfSlicedSprite.renderSprite(base.renderData, options); } } } }