private void _updateView() { BattleHeroModel model = _model; HeroModel heroModel = model.getHeroModel(); Image head = UITools.createBallImg(model); if (head == null) { string img = heroModel.getBodyImg(); Sprite bodySprite = Resources.Load <Sprite> (img); bodyImg.sprite = bodySprite; } else { bodyImg.gameObject.SetActive(false); bodyImg = head; bodyImg.transform.SetParent(bodyImgContainer.transform); } hpSlider.maxValue = heroModel.getHp(); hpSlider.value = _model.getHp(); }
private void _updateHp(int reduceHp) { BattleHeroModel model = _bhModel; hpBar.setValue(model.getHp()); }