public void OnClickSort(GameObject obj) { m_PopupState.value = false; eRuneSort sort_type = eRuneSort.Grade; switch (obj.name) { case "btn_grade": sort_type = eRuneSort.Grade; break; case "btn_level": sort_type = eRuneSort.Level; break; case "btn_idn": sort_type = eRuneSort.IDN; break; } if (SortType == sort_type) { m_SortDirection.SetSpriteActive(!IsAscending); } else { m_SortDirection.SetSpriteActive(false); } SortType = sort_type; m_PopupLabel.text = Localization.Get("HeroSort" + SortType); OnSortCallback(); }
public void OnClickSort(GameObject obj) { m_PopupState.value = false; eCreatureSort sort_type = eCreatureSort.Grade; switch (obj.name) { case "btn_grade": sort_type = eCreatureSort.Grade; break; case "btn_level": sort_type = eCreatureSort.Level; break; case "btn_enchant": sort_type = eCreatureSort.Enchant; break; case "btn_idn": sort_type = eCreatureSort.IDN; break; case "btn_power": sort_type = eCreatureSort.Power; break; case "btn_hp": sort_type = eCreatureSort.HP; break; case "btn_attack": sort_type = eCreatureSort.Attack; break; case "btn_defense": sort_type = eCreatureSort.Defense; break; } if (IsSaleMode) { if (SortTypeSaleMode == sort_type) { IsAscendingSaleMode = !IsAscendingSaleMode; } else { IsAscendingSaleMode = false; } SortTypeSaleMode = sort_type; m_PopupLabel.text = Localization.Get("HeroSort" + SortTypeSaleMode); m_SortDirection.SetSpriteActive(IsAscendingSaleMode); } else { if (SortType == sort_type) { IsAscending = !IsAscending; } else { IsAscending = false; } SortType = sort_type; m_PopupLabel.text = Localization.Get("HeroSort" + SortType); m_SortDirection.SetSpriteActive(IsAscending); } OnSortCallback(); }
public void OnValueChangedToggle() { if (m_TogglePrivate.value && m_ToggleGame.value) { m_Confirm.SetSpriteActive(true); } else { m_Confirm.SetSpriteActive(false); } }
public void Init() { m_Profile.UpdateProfile(Network.PVPBattleInfo.enemy_info.leader_creature, Network.PVPBattleInfo.enemy_info.nickname, Network.PVPBattleInfo.enemy_info.player_level); m_EnemyDefenseTeam = Network.PVPBattleInfo.enemy_team_data; m_LeaderSkill.Init(m_EnemyDefenseTeam.LeaderCreature, m_EnemyDefenseTeam.UseLeaderSkillType); m_BG.SetSpriteActive(Network.PVPBattleInfo.enemy_info.account_idx == SHSavedData.AccountIdx); m_LabelMessage.text = Network.PVPBattleInfo.enemy_info.message; m_LabelRank.text = Localization.Format("PVPRank", Network.PVPBattleInfo.enemy_info.rank); foreach (var hero in m_EnemyDefenseTeam.Creatures.Select(c => c.creature)) { DungeonHero hero_item = m_HeroManager.GetNewObject <DungeonHero>(m_GridHeroes.transform, Vector3.zero); hero_item.Init(hero, false, false); hero_item.m_icon.flip = UIBasicSprite.Flip.Horizontally; } m_GridHeroes.Reposition(); m_LabelTeamPower.text = Localization.Format("PowerValue", m_EnemyDefenseTeam.Power); m_ReadyButtonObj.SetActive(m_bReadyToBattle); m_GridButtons.Reposition(); if (m_bReadyToBattle) { m_LabelCancel.text = Localization.Get("Cancel"); } else { m_LabelCancel.text = Localization.Get("OK"); } }
public void Init(MapStageDifficulty info) { StageInfo = info; MapCreatureInfo creature = StageInfo.Waves[0].Creatures.Find(c => c.CreatureType == eMapCreatureType.Boss); short level = CalculateLevel(creature.Level, StageInfo); m_LevelText.text = level.ToString(); m_ProfileImage.spriteName = string.Format("profile_{0}", creature.CreatureInfo.ID); m_Condition = StageInfo.CheckCondition; bool is_lock = m_Condition != null; m_Level.gameObject.SetActive(!is_lock); m_Lock.gameObject.SetActive(is_lock); m_ToggleAvailable.SetSpriteActive(!is_lock); foreach (UISprite sprite in m_DisableSprite) { if (is_lock) { sprite.color = m_DisableColor; } else { sprite.color = Color.white; } } gameObject.SetActive(true); }
void InitInternal(CreatureInfo creature_info, int grade, string level_text, string enchant_text, string showAttackType, bool border_bg) { for (int i = 0; i < m_Stars.Length; ++i) { m_Stars[i].gameObject.SetActive(i < grade); } m_Grid.Reposition(); character_border.SetSpriteActive(creature_info != null && creature_info.TeamSkill != null); string sprite_id = creature_info != null ? creature_info.ID : ""; string sprite_name = string.Format("cs_{0}", sprite_id); string new_sprite_name = "_cut_" + sprite_name; UISpriteData sp = m_icon.atlas.CloneCustomSprite(sprite_name, new_sprite_name); if (sp != null) { sp.height = sp.width; } m_icon.spriteName = new_sprite_name; gameObject.name = string.Format("eh_{0}", sprite_id); m_level.text = level_text; m_enchant.text = enchant_text; m_label_in_team.text = TeamDataManager.Instance.GetTeamString(Creature); m_type.spriteName = string.Format("New_hero_info_hero_type_{0}", showAttackType); }
//--------------------------------------------------------------------------- public void Init(int rank_s, int rank_e, int gem, int pvp, pe_GoodsType token_type, bool selected) { if (rank_e <= 3 && rank_e > 0) { m_SpriteRank.spriteName = string.Format("arena_ranking_{0}", rank_e); m_labelRank.gameObject.SetActive(false); m_SpriteRank.gameObject.SetActive(true); } else { if (rank_e < 0) { m_labelRank.text = Localization.Format("PVPRewardRank", rank_s, ""); } else { m_labelRank.text = Localization.Format("PVPRewardRank", rank_s, rank_e); } m_labelRank.gameObject.SetActive(true); m_SpriteRank.gameObject.SetActive(false); } //Debug.LogFormat("{0}, {1}",gem, pvp); m_labelTokenGem.text = "x" + Localization.Format("GoodsFormat", gem); m_labelTokenPvp.text = "x" + Localization.Format("GoodsFormat", pvp); m_SpriteGem.SetActive(gem > 0); m_SpritePvp.SetActive(pvp > 0); m_SpriteToken.spriteName = token_type.ToString(); m_BG.SetSpriteActive(selected); }
public void Init(AdventureInfo map_info, System.Action <AdventureInfo> callback) { m_AdvantureInfo = map_info; var detail = AdventureInfoManager.Instance.GetInfo(map_info.IDN); m_Progress.SetActive(false); m_Complete.SetActive(false); if (detail != null && detail.is_rewarded == false) { if (Network.Instance.ServerTime > detail.end_at) { m_Complete.SetActive(true); } else if (detail.is_begin && Network.Instance.ServerTime < detail.end_at) { m_Progress.SetActive(true); m_EndTime = detail.end_at; } } m_labelTitle.text = m_AdvantureInfo.Name; m_ToggleSprite.SetSpriteActive(false); m_Toggle.value = false; m_Toggle.Set(false); this.callback = callback; m_SpriteLock.gameObject.SetActive(m_AdvantureInfo.CheckCondition() != null); }
//--------------------------------------------------------------------------- public void Init(pd_PvpPlayerInfo info, bool selected) { m_PVPInfo = info; if (info.rank <= 3) { m_SpriteRank.spriteName = string.Format("arena_ranking_{0}", info.rank); m_labelRank.gameObject.SetActive(false); m_SpriteRank.gameObject.SetActive(true); } else { m_labelRank.text = info.rank.ToString(); m_labelRank.gameObject.SetActive(true); m_SpriteRank.gameObject.SetActive(false); } m_labelMessage.text = info.message; if (m_Profile == null) { m_Profile = NGUITools.AddChild(m_ProfileIndicator, m_ProfilePrefab).GetComponent <PlayerProfile>(); } m_Profile.UpdateProfile(info.leader_creature, info.nickname, info.player_level); // #if !UNITY_EDITOR // if (selected == true) // { // m_BtnDetail.GetComponent<BoxCollider2D>().enabled = false; // m_BtnDetail.SetState(UIButtonColor.State.Disabled, true); // m_BtnDetail.enabled = false; // } // else // #endif // { // m_BtnDetail.GetComponent<BoxCollider2D>().enabled = true; // m_BtnDetail.SetState(UIButtonColor.State.Normal, true); // m_BtnDetail.enabled = true; // } m_BG.SetSpriteActive(selected); }
//--------------------------------------------------------------------------- public void Init(Creature creature) { CreatureInfo = creature; character.spriteName = string.Format("cs_{0}", CreatureInfo.Info.ID); name = character.spriteName; character_type.spriteName = string.Format("hero_info_hero_{0}", CreatureInfo.Info.ShowAttackType); for (int i = 0; i < stars.Length; ++i) { stars[i].SetActive(i < CreatureInfo.Grade); } gradeGrid.gameObject.SetActive(bActiveGrade = false); m_LabelName.text = creature.Info.Name; m_LabelLevel.text = string.Format("Lv{0}", creature.Level); m_SpriteWeapon.spriteName = creature.Weapon.Info.ID; m_SpriteArmor.spriteName = creature.Armor.Info.ID; m_ToggleWeaponFull.value = creature.Weapon.EnchantLevel >= 5; m_ToggleArmorFull.value = creature.Armor.EnchantLevel >= 5; if (m_ToggleArmorFull.value == true) { m_SpriteArmorFull.SetSpriteActive(creature.Weapon.AvailableUpgrade()); } else { for (int i = 0; i < 3; ++i) { m_ToggleArmorStuff[i].SetSpriteActive(creature.Armor.Stuffs[i].Count > 0); } } if (m_ToggleWeaponFull.value == true) { m_SpriteWeaponFull.SetSpriteActive(creature.Weapon.AvailableUpgrade()); } else { for (int i = 0; i < 3; ++i) { m_ToggleWeaponStuff[i].SetSpriteActive(creature.Weapon.Stuffs[i].Count > 0); } } SetDragDrop(bDragDropEnable); m_Notify.SetActive(CreatureInfo.IsNotify); gameObject.SetActive(true); }
public void Init(MapStageDifficulty info, short rating) { StageInfo = info; bool bAvailable = MapClearDataManager.Instance.AvailableStage(StageInfo); if (bAvailable == false) { rating = 0; } if (bAvailable == false) { m_ToggleAvailable.SetSpriteActive(bAvailable); } else { if (StageInfo.Difficulty == PacketEnums.pe_Difficulty.Normal) { m_ToggleAvailable.spriteName = "dungeon_in_in_on"; } else { m_ToggleAvailable.spriteName = "dungeon_in_in_on_hard"; } } gameObject.GetComponent <BoxCollider2D>().enabled = bAvailable; if (rating <= 0) { m_Stars.SetActive(false); } else { m_Stars.SetActive(true); for (int i = 0; i < m_ToggleRating.Length; ++i) { m_ToggleRating[i].SetSpriteActive(rating > i); } } gameObject.SetActive(true); if (info.StageType == eStageType.Boss) { m_BossParticle.Play(); } else { m_BossParticle.Stop(); } }
public void RefreshGoodBadCount() { switch (info.my_eval_state) { case pe_EvalState.None: m_GoodBtn.SetSpriteActive(false); m_BadBtn.SetSpriteActive(false); break; case pe_EvalState.Good: m_GoodBtn.SetSpriteActive(true); m_BadBtn.SetSpriteActive(false); break; case pe_EvalState.Bad: m_GoodBtn.SetSpriteActive(false); m_BadBtn.SetSpriteActive(true); break; } m_GoodCountLabel.text = info.good.ToString(); m_BadCountLabel.text = info.bad.ToString(); }
void InitCreatureInternal(CreatureInfo creature_info, short grade) { gameObject.SetActive(true); m_creature.SetActive(true); string sprite_name = string.Format("cs_{0}", creature_info.ID); string new_sprite_name = "_cut_" + sprite_name; UISpriteData sp = m_creature_sprite.atlas.CloneCustomSprite(sprite_name, new_sprite_name); if (sp != null) { sp.height = sp.width; } m_creature_sprite.spriteName = new_sprite_name; m_StuffGrade.SetActive(true); m_LabelGrade.gameObject.SetActive(true); m_LabelGrade.text = grade.ToString(); m_RewardCreature = creature_info; character_border.SetSpriteActive(creature_info != null && creature_info.TeamSkill != null); }
public void Init(Equip equip) { m_ToggleFull.value = equip.EnchantLevel >= 5; if (m_ToggleFull.value == true) { m_SpriteFull.SetSpriteActive(equip.AvailableUpgrade()); } else { for (int i = 0; i < 3 && i < equip.Stuffs.Count; ++i) { m_ToggleStuff[i].SetSpriteActive(equip.Stuffs[i].Count > 0); } } }
void InitCreatureInfo(CreatureInfo info) { gameObject.name = info.ID; string sprite_name = string.Format("cs_{0}", info.ID); string new_sprite_name = "_cut_" + sprite_name; UISpriteData sp = m_icon.atlas.CloneCustomSprite(sprite_name, new_sprite_name); if (sp != null) { sp.height = sp.width; } m_icon.spriteName = new_sprite_name; m_type.spriteName = string.Format("New_hero_info_hero_type_{0}", info.ShowAttackType); character_border.SetSpriteActive(info.TeamSkill != null); }
public void Init(CreatureInfo creature_info, short grade, bool is_block) { m_MyselfObj.SetActive(true); m_BlockObj.gameObject.SetActive(is_block); info = creature_info; this.grade = grade; if (info == null) { return; } gameObject.name = info.ID; string sprite_name = string.Format("cs_{0}", info.ID); if (m_CharacterSprite.atlas.Contains(sprite_name) == false) { sprite_name = "cs_empty"; } string new_sprite_name = "_cut_" + sprite_name; UISpriteData sp = m_CharacterSprite.atlas.CloneCustomSprite(sprite_name, new_sprite_name); if (sp != null) { if (sprite_name == "cs_empty") { sp.y += (sp.height - sp.width) / 2; } sp.height = sp.width; } m_CharacterSprite.spriteName = new_sprite_name; m_CharacterType.spriteName = string.Format("New_hero_info_hero_type_{0}", info.ShowAttackType); m_CharacterBoarder.SetSpriteActive(info.TeamSkill != null); m_CharacterLabel.text = info.Name; for (int i = 0; i < m_Stars.Count; ++i) { m_Stars[i].gameObject.SetActive(grade > i); } m_GridStars.gameObject.SetActive(true); m_GridStars.Reposition(); }
public void Init(pd_WorldBossPlayerInfo player_info, TeamData team_data) { m_Profile.UpdateProfile(player_info.leader_creature, player_info.nickname, player_info.player_level); m_LeaderSkill.Init(team_data.LeaderCreature, team_data.UseLeaderSkillType); m_BG.SetSpriteActive(player_info.account_idx == SHSavedData.AccountIdx); m_LabelMessage.text = Localization.Format("WorldBossBestInBattle", player_info.score); m_LabelRank.text = Localization.Format("PVPRank", player_info.rank); foreach (var hero in team_data.Creatures.Select(c => c.creature)) { DungeonHero hero_item = m_HeroManager.GetNewObject <DungeonHero>(m_GridHeroes.transform, Vector3.zero); hero_item.Init(hero, false, false); hero_item.m_icon.flip = UIBasicSprite.Flip.Horizontally; } m_GridHeroes.Reposition(); m_LabelTeamPower.text = Localization.Format("PowerValue", team_data.Power); }
public void Init(Creature creature, short point = 0, System.Action <Creature> onClick = null) { Creature = creature; OnClickCallback = onClick; EnchantPoint = point; m_Info.value = Creature != null; if (Creature != null) { for (int i = 0; i < m_Stars.Length; ++i) { m_Stars[i].gameObject.SetActive(i < creature.Grade); } m_Grid.Reposition(); string sprite_name = string.Format("cs_{0}", Creature.Info.ID); string new_sprite_name = "_cut_" + sprite_name; UISpriteData sp = m_icon.atlas.CloneCustomSprite(sprite_name, new_sprite_name); if (sp != null) { sp.height = sp.width; } m_icon.spriteName = new_sprite_name; m_type.spriteName = string.Format("New_hero_info_hero_type_{0}", Creature.Info.ShowAttackType); m_level.text = creature.GetLevelText(); m_enchant.text = creature.GetEnchantText(); m_enchant_point.text = string.Format("+{0}%", point); m_enchant_point.gameObject.SetActive(point > 0); } else { m_icon.spriteName = "black"; } character_border.SetSpriteActive(Creature != null && Creature.Info.TeamSkill != null); gameObject.SetActive(true); }
//--------------------------------------------------------------------------- public void Init(Creature creature, OnDeepTouchCharacterDelegate _deep = null) { gameObject.SetActive(true); if (creature == null) { System.Array.ForEach(gameObject.GetComponentsInChildren(typeof(UIWidget), true), o => o.GetComponent <UIWidget>().enabled = false); return; } else { System.Array.ForEach(gameObject.GetComponentsInChildren(typeof(UIWidget), true), o => o.GetComponent <UIWidget>().enabled = true); } Creature = creature; character_border.SetSpriteActive(Creature.Info.TeamSkill != null); character.spriteName = string.Format("cs_{0}", Creature.Info.ID); name = string.Format("hi_{0}", Creature.Info.ID); character_type.spriteName = string.Format("New_hero_info_hero_type_{0}", Creature.Info.ShowAttackType); for (int i = 0; i < stars.Length; ++i) { stars[i].SetActive(i < Creature.Grade); } gradeGrid.gameObject.SetActive(true); gradeGrid.Reposition(); m_LabelName.text = creature.Info.Name; m_LabelLevel.text = creature.GetLevelText(); m_LabelEnchant.text = creature.GetEnchantText(); m_LabelInTeam.text = TeamDataManager.Instance.GetTeamString(creature); OnDeepTouchCharacter = _deep; SetSelect(false); m_Notify.SetActive(Creature.IsNotify); }
public void OnFinishTween(UIToggleSprite sprite) { sprite.SetSpriteActive(true); BoxCollider2D parent = sprite.GetComponentInParent <BoxCollider2D>(); string reward_desc = ""; short reward_index = 0; switch (parent.name) { case "Box_1": reward_desc = Localization.Get("MapClearReward_1"); reward_index = 0; break; case "Box_2": reward_desc = Localization.Get("MapClearReward_2"); reward_index = 1; break; case "Box_3": reward_desc = Localization.Get("MapClearReward_3"); reward_index = 2; break; } parent.enabled = false; m_BoxEffects[reward_index].SetActive(false); GameMain.Instance.UpdatePlayerInfo(); List <RewardBase> rewards = MapClearRewardInfoManager.Instance.GetInfoByIdn(m_SelectedMapInfo.IDN).conditions(CurrentDifficulty)[reward_index].rewards; Popup.Instance.Show(ePopupMode.Reward, rewards, Localization.Get("PopupRewardTitle"), reward_desc, m_temp_map_clear_reward_ack); m_temp_map_clear_reward_ack = null; }
void InitInternal(CreatureInfo creature_info, int grade, string level_text, string enchant_text, string showAttackType, bool border_bg) { if (m_Collider == null) { m_Collider = gameObject.GetComponent <BoxCollider2D>(); } m_Collider.enabled = OnToggleCharacter != null; for (int i = 0; i < m_Stars.Length; ++i) { m_Stars[i].gameObject.SetActive(i < grade); } m_Grid.Reposition(); character_border.SetSpriteActive(creature_info != null && creature_info.TeamSkill != null); string sprite_id = creature_info != null?creature_info.ID:""; if (string.IsNullOrEmpty(sprite_id)) { m_icon.spriteName = "black"; } else { m_icon.spriteName = string.Format("cs_{0}", sprite_id); } m_icon.flip = UIBasicSprite.Flip.Nothing; gameObject.name = string.Format("dh_{0}", sprite_id); m_level.text = level_text; m_enchant.text = enchant_text; m_type.gameObject.SetActive(!string.IsNullOrEmpty(showAttackType)); m_type.spriteName = string.Format("New_hero_info_hero_type_{0}", showAttackType); }
//--------------------------------------------------------------------------- public void Init(CreatureInfo info, OnSelectDelegate _del = null) { CreatureInfo = info; if (CreatureInfo == null) { gameObject.SetActive(true); m_icon.spriteName = ""; m_type.spriteName = ""; character_border.spriteName = ""; return; } gameObject.name = info.ID; string sprite_name = string.Format("cs_{0}", info.ID); string new_sprite_name = "_cut_" + sprite_name; UISpriteData sp = m_icon.atlas.CloneCustomSprite(sprite_name, new_sprite_name); if (sp != null) { sp.height = sp.width; } m_icon.spriteName = new_sprite_name; m_type.spriteName = string.Format("New_hero_info_hero_type_{0}", info.ShowAttackType); gameObject.SetActive(true); character_border.SetSpriteActive(info.TeamSkill != null); OnSelect = _del; //if (OnSelect != null) // m_tooltip.span_press_time = 0.2f; //else // m_tooltip.span_press_time = 0f; }
void UpdateLock() { m_SpriteLocked.SetSpriteActive(m_Creature.IsLock); m_LabelLock.text = Localization.Get(m_Creature.IsLock ? "UnLock" : "Lock"); }