예제 #1
0
        private int TextToProgress(UnitDetailsType type, float textValue)
        {
            int progressValue = 1;

            if (type == UnitDetailsType.AttackPerSecond)
            {
                for (int i = 0; i < textToProgressDict[type].Count; i++)
                {
                    if (textValue <= textToProgressDict[type][i])
                    {
                        progressValue = i + 2;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else
            {
                for (int i = 0; i < textToProgressDict[type].Count; i++)
                {
                    if (textValue >= textToProgressDict[type][i])
                    {
                        progressValue = i + 2;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            return(progressValue);
        }
예제 #2
0
        public void SetInfoProgressValue(UnitDetailsType type, int showNum)
        {
            showNum++;
            int count = infoDict[type].Progress.childCount;

            for (int i = 1; i < count; i++)
            {
                if (i < showNum)
                {
                    infoDict[type].Progress.GetChild(i).gameObject.SetActive(true);
                }
                else
                {
                    infoDict[type].Progress.GetChild(i).gameObject.SetActive(false);
                }
            }
        }
예제 #3
0
 public void SetInfoTextValue(UnitDetailsType type, string value)
 {
     infoDict[type].Text.text = value;
 }