public void On_HeroListScrollView_ResetItem(GameObject go, int index) { Logic.UI.CommonHeroIcon.View.CommonHeroIcon commonHeroIcon = go.GetComponent <Logic.UI.CommonHeroIcon.View.CommonHeroIcon>(); go.name = index.ToString(); commonHeroIcon.SetRoleInfo(_cachedHeroInfoList[index]); RoleDesButton.Get(go).SetRoleInfo(_cachedHeroInfoList[index]); commonHeroIcon.SetInFormation(ManageHeroesProxy.instance.IsHeroInFormation(_cachedHeroInfoList[index].instanceID)); commonHeroIcon.onClickHandler = ClickRoleButtonHandler; bool selectedRole = _selectedRoleInfo != null && commonHeroIcon.HeroInfo.instanceID == _selectedRoleInfo.instanceID; commonHeroIcon.SetSelect(selectedRole); }
private void RefreshHero() { // roleRoot.SetActive(true); // if (_roleInfo is PlayerInfo) // { // heroHeadIcon.sprite = ResMgr.instance.Load<Sprite>((_roleInfo as PlayerInfo).PetHeadIcon); // } // else // { // heroHeadIcon.sprite = ResMgr.instance.Load<Sprite>(_roleInfo.HeadIcon); // } // RefreshStars(); // // if (roleTypeIconImage != null) // { // roleTypeIconImage.sprite = UIUtil.GetRoleTypeSmallIconSprite(_roleInfo.heroData.roleType); // roleTypeIconImage.gameObject.SetActive(true); // } // SetName(Localization.Get(_roleInfo.heroData.name)); roleRoot.SetActive(false); if (_commonHeroIcon == null) { _commonHeroIcon = UI.CommonHeroIcon.View.CommonHeroIcon.Create(transform); } if (_roleInfo is PlayerInfo) { _commonHeroIcon.SetPlayerInfo(_roleInfo as PlayerInfo); } else { _commonHeroIcon.SetHeroInfo(_roleInfo as HeroInfo); } RoleDesButton btn = RoleDesButton.Get(_commonHeroIcon.gameObject); btn.SetRoleInfo(_roleInfo); if (_commonHeroIcon != null) { _commonHeroIcon.gameObject.SetActive(true); } if (_commonEquipIcon != null) { _commonEquipIcon.gameObject.SetActive(false); } if (_commonItemIcon != null) { _commonItemIcon.gameObject.SetActive(false); } }
public void OnResetItemHandler(GameObject go, int index) { ExpeditionHeroButton icon = go.GetComponent <ExpeditionHeroButton>(); ExpeditionHeroInfo info = _cachedExpeditionHeroInfoList[index]; icon.SetExpeditionHeroInfo(info); RoleDesButton.Get(go).SetRoleInfo(info.roleInfo); icon.onClickHandler = ClickRoleButtonHandler; icon.SetInFormation(ExpeditionFormationProxy.instance.IsHeroInFormation(info.roleInfo.instanceID)); bool selectedRole = _selectedRoleInfo != null && info.roleInfo.instanceID == _selectedRoleInfo.instanceID; icon.SetSelect(selectedRole); }
private void ResetEnemies(DungeonData dungeonData) { TransformUtil.ClearChildren(enemiesRootTransform, true); List <HeroInfo> heroPresentList = dungeonData.heroPresentList; int heroCount = heroPresentList.Count; for (int i = 0; i < heroCount; i++) { CommonHeroIcon.View.CommonHeroIcon commonHeroIcon = CommonHeroIcon.View.CommonHeroIcon.Create(enemiesRootTransform); commonHeroIcon.SetHeroInfo(heroPresentList[i]); RoleDesButton.Get(commonHeroIcon.gameObject).SetRoleInfo(heroPresentList[i], ShowDescriptionType.click); } }
public void OnResetItemHandler(GameObject go, int index) { Logic.UI.CommonHeroIcon.View.CommonHeroIcon icon = go.GetComponent <Logic.UI.CommonHeroIcon.View.CommonHeroIcon>(); go.name = index.ToString(); HeroInfo info = _cachedHeroInfoList[index]; RoleDesButton.Get(go).SetRoleInfo(info); icon.SetRoleInfo(info); icon.onClickHandler = ClickRoleButtonHandler; icon.SetInFormation(PvpFormationProxy.instance.IsHeroInFormation(info.instanceID)); bool selectedRole = _selectedRoleInfo != null && icon.HeroInfo.instanceID == _selectedRoleInfo.instanceID; icon.SetSelect(selectedRole); }
public static void GetRoleDesButton(GameObject go, LuaTable roleInfo, bool isPlayer, bool isLongPress = true) { RoleDesButton btn = RoleDesButton.Get(go); ShowDescriptionType type = isLongPress ? ShowDescriptionType.longPress : ShowDescriptionType.click; if (isPlayer) { btn.SetRoleInfo(new PlayerInfo(roleInfo), type); } else { btn.SetRoleInfo(new HeroInfo(roleInfo), type); } }
public void RefreshUIMonsters() { List <HeroInfo> monsters = DungeonDetailProxy.instance.GetMonstersList(); HeroInfo info; TransformUtil.ClearChildren(TranMonsterRoot, true); for (int i = 0, count = monsters.Count; i < count; i++) { info = monsters[i]; CommonHeroIcon.View.CommonHeroIcon heroIcon = CommonHeroIcon.View.CommonHeroIcon.Create(TranMonsterRoot); RoleDesButton.Get(heroIcon.gameObject).SetRoleInfo(info, ShowDescriptionType.click); heroIcon.SetHeroInfo(info); heroIcon.HideLevel(); } }
public void RefreshMonsterIcons() { TransformUtil.ClearChildren(monsterRoot, true); List <HeroInfo> monsters = _selectedWorldTreeDungeonInfo.dungeonData.heroPresentList; HeroInfo info = null; for (int i = 0, count = monsters.Count; i < count; i++) { info = monsters[i]; CommonHeroIcon.View.CommonHeroIcon heroIcon = CommonHeroIcon.View.CommonHeroIcon.Create(monsterRoot); // heroIcon.transform.localScale = new Vector3(0.68f,0.68f,1); RoleDesButton.Get(heroIcon.gameObject).SetRoleInfo(info, ShowDescriptionType.click); heroIcon.SetHeroInfo(info); heroIcon.HideLevel(); } }
public static void GetRoleDesButton(GameObject go, int id, int star, bool isShowBase, bool isLongPress = true) { RoleDesButton btn = RoleDesButton.Get(go); ShowDescriptionType type = isLongPress ? ShowDescriptionType.longPress : ShowDescriptionType.click; if (isShowBase) { btn.SetRoleInfo(new GameResData(BaseResType.Hero, id, 0, star), type); } else { if (GameProxy.instance.IsPlayer((uint)id)) { btn.SetRoleInfo(GameProxy.instance.PlayerInfo, type); } else { btn.SetRoleInfo(Logic.Hero.Model.HeroProxy.instance.GetHeroInfo((uint)id), type); } } }
public void SetData(BlackMarketInfo info, bool bigHero = false, ShowDescriptionType clickType = ShowDescriptionType.longPress) { blackMarketInfo = info; if (_commonRewardIcon != null) { GameObject.DestroyObject(_commonRewardIcon.gameObject); } if (_commonHeroIcon != null) { GameObject.DestroyObject(_commonHeroIcon.gameObject); } if (bigHero) { _commonHeroIcon = CommonHeroIcon.View.CommonHeroIcon.CreateBigIcon(transform); _commonHeroIcon.transform.SetAsFirstSibling(); _commonHeroIcon.SetGameResData(info.itemData); RoleDesButton.Get(_commonHeroIcon.gameObject).SetRoleInfo(info.itemData, clickType); } else { _commonRewardIcon = CommonRewardIcon.Create(transform); _commonRewardIcon.transform.SetAsFirstSibling(); _commonRewardIcon.SetGameResData(info.itemData); if (clickType == ShowDescriptionType.longPress) { _commonRewardIcon.onClickHandler = OnClickRewardBtnHandler; } _commonRewardIcon.SetDesButtonType(clickType); } remaindCountText.text = info.remaindCountString; if (maskGameObject != null) { maskGameObject.SetActive(GameProxy.instance.AccountLevel < blackMarketInfo.limitLv); limitLevelText.text = string.Format(Localization.Get("ui.black_market_view.limit_lv"), blackMarketInfo.limitLv); } GetComponent <Image>().enabled = false; }
public static void SetRoleDesButton(GameObject go, bool enabled) { RoleDesButton.Get(go).enabled = enabled; }
public static void SetRoleDesBtnType(GameObject go, int tp) { RoleDesButton btn = RoleDesButton.Get(go); btn.SetType((Logic.Enums.ShowDescriptionType)tp); }