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();
     }
 }
Esempio n. 3
0
    public void SetValue(FloatDataSO data)
    {
        var newData = data as FloatDataSO;

        if (newData != null)
        {
            value = newData.value;
        }
    }
Esempio n. 4
0
    public void UpdateValue(FloatDataSO data)
    {
        var newData = data as FloatDataSO;

        if (newData != null)
        {
            value += newData.value;
        }
    }
Esempio n. 5
0
 public void UpdateText(FloatDataSO dataObj)
 {
     tmpObj.text = dataObj.value.ToString();
 }
Esempio n. 6
0
 private void Start()
 {
     dataObj = GetComponent <InstantiateSOBehavior>().soObjClone;
 }
 public void InstantiateFloatDataSO()
 {
     soObjClone = Instantiate(soObj);
 }