void Start()
 {
     for (int i = 0; i < icon.Length; i++)
     {
         line.index = i;
         line.obj   = Instantiate(prefabsUITextRow, Vector3.zero, Quaternion.identity, gameObject.transform);
         if (i == 1)
         {
             line.title = ("HP  " + getHeathAndBaseHealth()).Split(':');
         }
         else if (i == 2)
         {
             line.title = ("MP  " + getManaAndBaseMana()).Split(':');
         }
         else
         {
             line.title = title[i].Split(':');
         }
         line.icon = icon[i];
         curPrefab.Add(line);
         uIListRowText = curPrefab[i].obj.GetComponent <UIListRowText>();
         string content = "";
         foreach (string item in curPrefab[i].title)
         {
             content += item + " ";
         }
         uIListRowText.setText(content);
         uIListRowText.setIcon(curPrefab[i].icon);
     }
 }
 public void setManaUI(float mana, float baseMana)
 {
     if (curPrefab.Count != 0)
     {
         uIListRowText = curPrefab[2].obj.GetComponent <UIListRowText>();
         uIListRowText.setText("MP:  " + mana.ToString() + "/" + baseMana.ToString());
     }
 }
 public void setHealthUI(float health, float baseHealth)
 {
     if (curPrefab.Count != 0)
     {
         uIListRowText = curPrefab[1].obj.GetComponent <UIListRowText>();
         uIListRowText.setText("HP  " + health.ToString() + "/" + baseHealth);
     }
 }
Esempio n. 4
0
 void Start()
 {
     for (int i = 0; i < icon.Length; i++)
     {
         line.index = i;
         line.obj   = Instantiate(prefabsUITextRow, Vector3.zero, Quaternion.identity, gameObject.transform);
         if (i == 0)
         {
             string completeMap1Percent = Math.Round((getCompleteMap1PercentDel() * 100), 2).ToString();
             line.title = ("Map1 " + completeMap1Percent + "%").Split(':');
         }
         else if (i == 1)
         {
             string completeMap2Percent = Math.Round((getCompleteMap2PercentDel() * 100), 2).ToString();
             line.title = ("Map2 " + completeMap2Percent + "%").Split(':');
         }
         else if (i == 2)
         {
             string abilityCompletePercent = getCompleteAbilityPercentDel().ToString();
             line.title = ("Ability Progress  " + abilityCompletePercent + "%").Split(':');
         }
         else if (i == 3)
         {
             string itemCollectedPercent = getItemCollectedPercentDel();
             line.title = ("Item Collected  " + itemCollectedPercent).Split(':');
         }
         else if (i == 4)
         {
             float killedCreepAmount = getKilledCreepAmountDel();
             line.title = ("Killed Creep  " + killedCreepAmount.ToString()).Split(':');
         }
         line.icon = icon[i];
         curPrefab.Add(line);
         uIListRowText = curPrefab[i].obj.GetComponent <UIListRowText>();
         string content = "";
         foreach (string item in curPrefab[i].title)
         {
             content += item + " ";
         }
         uIListRowText.setText(content);
         uIListRowText.setIcon(curPrefab[i].icon);
     }
 }