// 显示每一个英雄的数据 英雄的表数据 对应的神器 需要的英雄数量 索引 public void ShowInfo(HeroTemplate heroData, Artifact artifact, int heroNumber, int index) { _heroData = heroData; _artifact = artifact; tableID = heroData.getId(); // 星级 int quality = heroData.getQuality(); for (int i = 5; i < quality + 5; i++) { _star.transform.GetChild(i).gameObject.SetActive(true); } // icon ArtresourceTemplate artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(heroData.getArtresources()); Sprite _img = UIResourceMgr.LoadSprite(common.defaultPath + artresourcedata.getHeadiconresource()); _icon.sprite = _img; //图片 _icon.SetNativeSize(); // 名称 _name.text = GameUtils.getString(heroData.getTitleID()); ShowCount(index, heroNumber); }
/// <summary> /// 显示等级 经验 技能刷新 /// </summary> /// <param name="heroData"></param> /// <param name="level"></param> private void ShowData(int level = 1) { ObjectCard _card = new ObjectCard(); Hero hero = new Hero(); hero.skill1 = m_HeroData.getSkill1ID(); hero.skill2 = m_HeroData.getSkill2ID(); hero.skill3 = m_HeroData.getSkill3ID(); hero.heroid = m_HeroData.getId(); hero.herolevel = level; hero.heroviewid = m_HeroData.getArtresources(); _card.GetHeroData().Init(hero); m_Card = _card; ShowHeroLevelAndExp(_card); InitSkillInfo(_card); UpBtnGrayShow(); }
public override void Process() { //if (result == END_OK) //{ // if (lotterytype == 1) // { // UI_HeroRecruit.inst.InitTipsText(); // UI_HeroRecruit.inst.SuccessBuyOne(herolist); // } // else if (lotterytype == 2) // { // UI_HeroRecruit.inst.InitTipsText(); // UI_HeroRecruit.inst.SuccessBuyTen(herolist); // } // else if (lotterytype == 3) // { // UI_HeroRecruit.inst.InitTipsText(); // UI_HeroRecruit.inst.SuccessExchangeHero(herolist); // } // else if (lotterytype == 4) // { // UI_HeroRecruit.inst.InitTipsText(); // UI_HeroRecruit.inst.SuccessBuyOne(herolist); // } // else // { // //Debug.Log("Slorrery 未知类型"); // } // UI_Recruit.inst.RefreshController(); //} //else //{ // UI_HeroRecruit.inst.RefreshDreamValue(); // Debug.Log("SLotery fail"); //} if (result == END_OK) { Debug.LogError("--------物品" + items.Count + "个"); foreach (Items item in items) { ItemTemplate itemT = DataTemplate.GetInstance().GetItemTemplateById(item.itemid); Debug.LogError(itemT.getId() + "个数" + item.num); } Debug.LogError("--------英雄" + herolist.Count + "个"); foreach (int heroId in herolist) { HeroTemplate heroT = DataTemplate.GetInstance().GetHeroTemplateById(heroId); Debug.LogError(heroT.getId()); } } }
ObjectCard GetObjectCard(int heroID) { HeroTemplate heroT = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(heroID); ObjectCard obj = new ObjectCard(); Hero hero = new Hero(); hero.skill1 = heroT.getSkill1ID(); hero.skill2 = heroT.getSkill2ID(); hero.skill3 = heroT.getSkill3ID(); hero.heroid = heroT.getId(); hero.herolevel = 1; hero.heroviewid = heroT.getArtresources(); obj.GetHeroData().Init(hero); return(obj); }
/// <summary> /// 初始化是否置灰以及是否显示勋章图标 /// </summary> private void InitIsGrey() { GameUtils.SetImageGrayState(m_Icon, true); m_MedalImg.enabled = false; for (int i = 0; i < ObjectSelf.GetInstance().GetHeroHandBookList().Count; i++) { if (ObjectSelf.GetInstance().GetHeroHandBookList()[i].heroid == m_HeroData.getId()) { GameUtils.SetImageGrayState(m_Icon, false); if (ObjectSelf.GetInstance().GetHeroHandBookList()[i].flag == 1) { m_MedalImg.enabled = true; } } } }
public void SetShowData(HeroTemplate heroT, int level = 1) { ObjectCard obj = new ObjectCard(); Hero hero = new Hero(); hero.skill1 = heroT.getSkill1ID(); hero.skill2 = heroT.getSkill2ID(); hero.skill3 = heroT.getSkill3ID(); hero.heroid = heroT.getId(); hero.herolevel = level; hero.heroviewid = heroT.getArtresources(); obj.GetHeroData().Init(hero); //HeroInfoPop.inst.Show3DModel(obj); ShowInfo(obj); Show3DModel(obj); }
/// <summary> /// 初始化进阶信息 /// </summary> private void InitShowOrderUpInfo() { m_HeroAdvances.Clear(); Dictionary <int, IExcelBean> _heroDatas = DataTemplate.GetInstance().m_HeroTable.getData(); foreach (var item in _heroDatas) { HeroTemplate _hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(item.Key); if (GameUtils.GetHeroIDNum(_hero.getId()) == GameUtils.GetHeroIDNum(m_HeroData.getId())) { m_HeroAdvances.Add(_hero); } } ListRank(); ClearModels(); CreateModel(); ShowHeroAdvanceShar(); ShowHeroAdvanceNameAndCos(); }
/// <summary> /// 创建队友 /// </summary> /// 如果释放目标为敌人就不创建该对象 private void CreateTeamMate() { SkillTemplate _skill = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.getTableData(m_Card.GetHeroData().SpellDataList[0].SpellID); if (_skill.getTarget() == 2) { return; } ObjectCard _teamMateCard = ObjectSelf.GetInstance().HeroContainerBag.GetHeroList()[0]; HeroTemplate _heroData = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(_teamMateCard.GetHeroData().TableID); //ObjectCard _teamMateCard = new ObjectCard(); //Hero hero = new Hero(); //hero.heroid = ObjectSelf.GetInstance().HeroContainerBag.GetHeroList()[0].GetHeroData().TableID; //_teamMateCard.GetHeroData().Init(hero); ArtresourceTemplate _artResData = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(_heroData.getArtresources()); GameObject _heroObject = AssetLoader.Inst.GetAssetRes(_artResData.getArtresources()); if (_heroObject != null) { GameObject _obj = Instantiate(_heroObject, m_TeamMatePos.position, m_TeamMatePos.rotation) as GameObject; _obj.transform.localScale = new Vector3(2, 2, 2); SceneObjectManager.GetInstance().SceneObjectAddHero(_obj, _heroData.getId(), _teamMateCard); Animation _anim = _obj.GetComponent <Animation>(); if (_anim == null) { return; } if (_obj.GetComponent <Animation>()["Idle1"] != null) { _obj.GetComponent <Animation>().CrossFade("Idle1"); } else if (_obj.GetComponent <Animation>()["Nidle1"] != null) { _obj.GetComponent <Animation>().CrossFade("Nidle1"); } _obj.GetComponent <Animation>().wrapMode = WrapMode.Loop; } }