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); }
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); } } }
public void SetInfoTextValue(UnitDetailsType type, string value) { infoDict[type].Text.text = value; }