public void UpdateState(HeroStateModel model) { Move(model.position.posX, model.position.posY, model.isForcedMove); if (Hud == null) return; int dmg = model.curHp - currentHp; currentHp = model.curHp; currentAp = model.curAp; maxHp = model.maxHp; maxAp = model.maxAp; // foreach(var skill in skills) // { // skill.isAvailable = currentAp >= skill.cost; // } if(dmg != 0) { Hud.OnDamage(dmg); } Hud.SetHp(maxHp, currentHp); Hud.SetAp(maxAp, currentAp); }
public void UpdateHero(HeroStateModel model, bool isMine) { if (isMine) { myMap.UpdateHero(model); } else { otherMap.UpdateHero(model); } menuPanel.UpdateMenu(); }
public void UpdateHero(HeroStateModel model) { var hero = GetCharacter(model.index); if (hero == null) return; hero.UpdateState(model); }