Exemplo n.º 1
0
    private void CalcWinResult()
    {
        DataMission mission  = DataManager.instance.dataMissionGroup.GetMission(_multiFightRequest.missionId);
        int         gotExp   = mission.exp;
        int         gotHonor = mission.honor;

        InstancePlayer.instance.model_User.UpdateHonor(gotHonor * _multiFightRequest.num);

        Model_HeroGroup heroGroup = InstancePlayer.instance.model_User.model_heroGroup;
        Model_Formation formation = InstancePlayer.instance.model_User.model_Formation;

        int[] HeroesId = formation.GetSelectTeamHeroesId();

        for (int i = 0; i < _multiFightRequest.num; ++i)
        {
            List <Model_HeroGroup.ExpChangeResult> result = new List <Model_HeroGroup.ExpChangeResult> ();
            InstancePlayer.instance.multiFightHeroGotExp.Add(result);

            foreach (int heroId in HeroesId)
            {
                if (heroId > 0)
                {
                    Model_HeroGroup.ExpChangeResult r = heroGroup.AddExp(heroId, gotExp);
                    result.Add(r);
                }
            }
        }
    }
Exemplo n.º 2
0
    private void UpdateHeroUI(GameObject cell, Model_HeroGroup.ExpChangeResult expHero)
    {
        UILabel name  = cell.transform.Find("Name").GetComponent <UILabel> ();
        UILabel level = cell.transform.Find("Level").GetComponent <UILabel> ();

        DataHero dataHero = DataManager.instance.dataHeroGroup.GetHeroPrimitive(expHero.heroId);

        name.text  = dataHero.name;
        level.text = expHero.level + "";
    }
 private void UpdateHerosExp(GameObject parentGrid, Model_HeroGroup.ExpChangeResult heroExp)
 {
     if (parentGrid != null)
     {
         GameObject btnItem = (GameObject)Resources.Load(AppConfig.FOLDER_PROFAB_UI + "battleSettlement/InstructorItem");
         GameObject item    = NGUITools.AddChild(parentGrid, btnItem);
         SettlementInstructorItem Itemclass = item.GetComponent <SettlementInstructorItem>();
         Itemclass.InitData(heroExp);
         _Drop_Grid.repositionNow = true;
         _Drop_Grid.Reposition();
     }
 }
Exemplo n.º 4
0
    public void InitData(Model_HeroGroup.ExpChangeResult heroExp)
    {
        _Level_Label.text     = "LV" + heroExp.level;
        _exp_Value_Label.text = "" + heroExp.expChanged;

        if (heroExp.levelChanged > 0)
        {
            _label_Tips.gameObject.SetActive(true);

            _label_Tips.text = "等级提升" + heroExp.levelChanged;
            tweenPos.PlayForward();
            tweenPos.SetOnFinished(FinishCallBack);
        }
        else
        {
            _label_Tips.gameObject.SetActive(false);
        }
    }