public Hero(NetMessages.HeroServerData hsData) { Id = hsData.Id; HeroDataInfo heroTableDataInfo = (HeroDataInfo)ConfigDataMgr.Instance.GetDataInfo <HeroTableData>(Id); Data = new HeroData(heroTableDataInfo, hsData.Lv); }
public HeroData(HeroDataInfo dataInfo, int lv) { Id = dataInfo.Id; Name = dataInfo.Name; Description = dataInfo.Description; Lv = new ENum <int>(lv); Sex = dataInfo.Sex; Hp = new ENum <int>(dataInfo.Hp); Mp = new ENum <int>(dataInfo.Mp); Def = new ENum <int>(dataInfo.Def); Att = new ENum <int>(dataInfo.Att); //PetId = new ENum<int>(dataInfo.Pet); //WeaponId = new ENum<int>(dataInfo.Weapon); //WeaponLv = new ENum<int>(1); //EquipId = new ENum<int>(dataInfo.Equip); //EquipLv = new ENum<int>(1); Job = dataInfo.Job; Icon = dataInfo.Icon; Cg = dataInfo.Cg; FightIcon = dataInfo.FightIcon; ColorUtility.TryParseHtmlString(dataInfo.Color, out TheColor); }
public void UnlockHero() { HeroChoose heroChoose = allHeroes[_indexChoose]; if (DataUtils.dicAllHero[heroChoose.heroID].pices >= DataUtils.PART_UNLOCK_P2) { heroSelected = DataUtils.dicAllHero[heroChoose.heroID]; DataUtils.dicAllHero[heroChoose.heroID].pices -= DataUtils.PART_UNLOCK_P2; DataUtils.dicAllHero[heroChoose.heroID].isUnlock = true; DataUtils.dicAllHero[heroChoose.heroID].isUnlock = true; heroChoose.isUnLock = true; heroChoose.imgLock.gameObject.SetActive(false); heroChoose.imgLock_.enabled = false; DataUtils.SaveAllHero(); pEvolveP2.Play(); HeroOnClick(_indexChoose); } else { MainMenuController.Instance.ShowMapNotify("You need " + (DataUtils.PART_UNLOCK_P2 - DataUtils.dicAllHero[heroChoose.heroID].pices) + " parts to unlock this hero"); } }
private void OnEnable() { for (int i = 0; i < lstEquip.Count; i++) { if (!dicAllEquip.ContainsKey(lstEquip[i].itemData.type)) { dicAllEquip.Add(lstEquip[i].itemData.type, lstEquip[i].itemData); } } if (heroSelected == null) { heroSelected = DataUtils.heroInfo; } ChangeAnim(DataUtils.HeroIndex() + 1); MyAnalytics.LogOpenHeroTab(); ChooseTab(0); InitEquippedItem(); HeroOnClick(/*0*/ DataUtils.HeroIndex()); //FillHeroData(DataUtils.HeroIndex()); }
private void FillData(HeroChoose heroChoose, bool showSelected) { heroChoose.imgSelected.enabled = showSelected; heroSelected = DataUtils.dicAllHero[heroChoose.heroID]; FillHeroData(heroChoose.heroIndex - 1); if (heroSelected.isUnlock) { DataUtils.heroInfo = DataUtils.dicAllHero[heroChoose.heroID]; } }