Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
 public void UpdateHero(HeroStateModel model, bool isMine)
 {
     if (isMine)
     {
         myMap.UpdateHero(model);
     }
     else
     {
         otherMap.UpdateHero(model);
     }
     menuPanel.UpdateMenu();
 }
Ejemplo n.º 3
0
    public void UpdateHero(HeroStateModel model)
    {
        var hero = GetCharacter(model.index);
        if (hero == null)
            return;

        hero.UpdateState(model);
    }