public virtual void Init(List <float> values) { m_parts.Clear(); for (int i = 0; i < values.Count; i++) { var m_part = new DiagramPart() { value = values[i] }; m_parts.Add(m_part); } }
public virtual void Init(float fillValue, DiagramPart origin) { this.origin = origin; baseImage.fillAmount = fillValue; baseImage.color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f)); if (valueText) { valueText.text = origin.value.ToString(); } if (percentageText) { percentageText.text = string.Format("{0} %", origin.percentage); } transform.SetAsFirstSibling(); }