HP Bar shows right percentage
This commit is contained in:
parent
6405508376
commit
ea5108b0f5
4 changed files with 17 additions and 10 deletions
|
|
@ -35,8 +35,7 @@ public class BattleController : MonoBehaviour
|
|||
heroSprites[i].transform.position = new Vector3(-6 + 6 * i, 0, 0);
|
||||
|
||||
heroUIs[i] = (HeroInfoUI) Instantiate(heroUIPrefab.gameObject, uiCanvas.transform).GetComponent(typeof(HeroInfoUI));
|
||||
heroUIs[i].target = heroSprites[i];
|
||||
heroUIs[i].battleParticipant = heroes[i];
|
||||
heroUIs[i].Init(heroSprites[i], heroes[i]);
|
||||
}
|
||||
|
||||
monsters = new BattleMonster[3];
|
||||
|
|
@ -53,8 +52,7 @@ public class BattleController : MonoBehaviour
|
|||
monsterSprites[i].transform.position = new Vector3(-6 + 6 * i, 3, 0);
|
||||
|
||||
monsterUIs[i] = (HeroInfoUI) Instantiate(heroUIPrefab.gameObject, uiCanvas.transform).GetComponent(typeof(HeroInfoUI));
|
||||
monsterUIs[i].target = monsterSprites[i];
|
||||
monsterUIs[i].battleParticipant = monsters[i];
|
||||
monsterUIs[i].Init(monsterSprites[i], monsters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue