void Start() { //Max and Min Filler Values m_FillerInfo = new FillerProperty(0, m_FillRect.rect.width); //Current and Max Filler Values m_Value = new ProgressValue(0, m_FillerInfo.MaxWidth); XOffset = (transform.GetComponent<RectTransform>().rect.width - m_FillRect.rect.width) /2 ; //We set the Filler size to zero at the start. SetFillerSize(0); }
void OnEnable() { //We set the Filler size to zero at the start. m_Value = new ProgressValue(0, FillerInfo.MaxWidth); m_XOffset = (transform.GetComponent<RectTransform>().rect.width - m_FillRect.rect.width) / 2; SetFillerSize(0); m_FillRect.localPosition = new Vector3(0, m_FillRect.localPosition.y, m_FillRect.localPosition.z); }