public void UpdateFillAmountPercentage(FloatDataSO dataObj) { var percentageValue = dataObj.value / dataObj.valueCap; if (percentageValue == 1) { FillAllImages(); } if (percentageValue < 1 && percentageValue > .33) { images[0].fillAmount = 0; images[1].fillAmount = 1; images[2].fillAmount = 1; } if (percentageValue < .66 && percentageValue > 0) { images[0].fillAmount = 0; images[1].fillAmount = 0; images[2].fillAmount = 1; } if (percentageValue <= 0) { images[0].fillAmount = 0; images[1].fillAmount = 0; images[2].fillAmount = 0; } }
public void ReplaceText(FloatDataSO data) { if (textObj) { textObj.text = data.value.ToString(); } }
public void SetValue(FloatDataSO data) { var newData = data as FloatDataSO; if (newData != null) { value = newData.value; } }
public void UpdateValue(FloatDataSO data) { var newData = data as FloatDataSO; if (newData != null) { value += newData.value; } }
public void UpdateText(FloatDataSO dataObj) { tmpObj.text = dataObj.value.ToString(); }
private void Start() { dataObj = GetComponent <InstantiateSOBehavior>().soObjClone; }
public void InstantiateFloatDataSO() { soObjClone = Instantiate(soObj); }