public void InitializeDefenderView(DefenderUnitLevel defenderLevel) { if (transform.childCount > 0) { for (var i = 0; i < transform.childCount; i++) { Destroy(transform.GetChild(i).gameObject); } } GameObject defender = defenderLevel.UnitPrefab; defender.transform.position = Vector3.zero; Instantiate(defender, transform); }
public void CurrentLevelInitialize(DefenderUnitLevel defenderUnitLevel) { expBar.maxValue = defenderUnitLevel.ExpToNextLvl; Icon.sprite = defenderUnitLevel.UnitSprite; }