public UIStatIndicator(Slider component, Attribute attribute, Manny.Manny manny) { _slider = SliderUtil.SetSliderBackground(component); _attribute = attribute; _text = _slider.GetComponentInChildren <Text>(); _manny = manny; }
public void Update() { if (_manny.Attribute.GetAttribute(_attribute) > _slider.value) { SliderUtil.GradualFill(_slider, _manny.Attribute.GetAttribute(_attribute)); } else { _slider.value = _manny.Attribute.GetAttribute(_attribute); } _text.text = (int)_slider.value + " / " + _slider.maxValue; }
/*--------------------------------------------------------------------------------------------*/ protected virtual void BuildSegments() { SliderUtil.CalculateSegments(vInfo, SegmentInfoList); SliderUtil.CalculateTicks(vInfo, SegmentInfoList, TickInfoList); IsJumpVisible = false; for (int i = 0; i < SegmentInfoList.Count; i++) { SliderUtil.SegmentInfo segInfo = SegmentInfoList[i]; if (segInfo.Type == SliderUtil.SegmentType.Jump) { IsJumpVisible = true; break; } } }
/// <summary> /// Makes the reference to the Manny instance /// </summary> /// <param name="manny">Manny main instance</param> public void SetInstance(Manny.Manny manny) { _manny = manny; Slider = SliderUtil.SetSliderBackground(Slider); Slider.maxValue = 5; }