void SetCondition(pe_UseLeaderSkillType condition, bool call_callback) { m_PopupState.value = false; Condition = condition; m_PopupLabel.text = Localization.Get("LeaderSkillCondition_" + Condition); if (call_callback) { m_OnChangedLeaderSkillCondition(Condition); } }
public MapCreatureInfo(XmlNode node) { string id = node.Attributes["id"].Value; if (id == "dummy") { return; } CreatureInfo = CreatureInfoManager.Instance.GetInfoByID(node.Attributes["id"].Value); SkinName = "default"; Level = short.Parse(node.Attributes["level"].Value); Grade = short.Parse(node.Attributes["grade"].Value); Enchant = short.Parse(node.Attributes["enchant"].Value); XmlAttribute typeAttr = node.Attributes["type"]; if (typeAttr != null) { CreatureType = (eMapCreatureType)Enum.Parse(typeof(eMapCreatureType), typeAttr.Value); } XmlAttribute showAttr = node.Attributes["show"]; if (showAttr != null) { IsShow = bool.Parse(showAttr.Value); } XmlAttribute autoSkillIndexAttr = node.Attributes["auto_skill_index"]; if (autoSkillIndexAttr != null) { AutoSkillIndex = short.Parse(autoSkillIndexAttr.Value); } XmlAttribute useLeaderSkillTypeAttr = node.Attributes["use_leader_skill_type"]; if (useLeaderSkillTypeAttr != null) { UseLeaderSkillType = (pe_UseLeaderSkillType)Enum.Parse(typeof(pe_UseLeaderSkillType), useLeaderSkillTypeAttr.Value); } PassiveInfos = new List <MapPassiveInfo>(); foreach (XmlNode childNode in node.SelectNodes("Passive")) { PassiveInfos.Add(new MapPassiveInfo(childNode)); } }
public void SetLeaderCreature(Creature creature, pe_UseLeaderSkillType use_leader_skill_type, bool save = true) { if (LeaderCreature == creature && UseLeaderSkillType == use_leader_skill_type) { return; } m_LeaderCreature = creature; this.UseLeaderSkillType = use_leader_skill_type; if (save == true) { TeamDataManager.Instance.Save(); } }
public void Init(pe_UseLeaderSkillType condition, OnChangedLeaderSkillConditionDelegate callback, pe_Team team_type) { m_OnChangedLeaderSkillCondition = callback; SetCondition(condition, false); UnlockAll(); switch (team_type) { case pe_Team.PVP: case pe_Team.PVP_Defense: SetLock(pe_UseLeaderSkillType.Manual); SetLock(pe_UseLeaderSkillType.LastWave); break; case pe_Team.Boss: SetLock(pe_UseLeaderSkillType.LastWave); break; } }
public void Init(Creature creature, pe_UseLeaderSkillType condition, OnLeaderSkillDelegate _del = null) { LeaderCreature = creature; UseLeaderSkillType = condition; gameObject.SetActive(true); OnLeaderSkill = _del; if (creature == null) { m_SpriteLeaderChar.spriteName = "black"; m_SpriteLeaderSkill.spriteName = "black"; return; } if (creature.TeamSkill != null) { if (m_SpriteLeaderSkill.atlas.Contains(creature.TeamSkill.Info.ID) == true) { m_SpriteLeaderSkill.spriteName = creature.TeamSkill.Info.ID; } else { m_SpriteLeaderSkill.spriteName = "skill_default"; } } else { m_SpriteLeaderSkill.spriteName = "none"; } string sprite_name = string.Format("cs_{0}", creature.Info.ID); string new_sprite_name = "_cut_" + sprite_name; UISpriteData sp = m_SpriteLeaderChar.atlas.CloneCustomSprite(sprite_name, new_sprite_name); if (sp != null) { sp.height = sp.width; } m_SpriteLeaderChar.spriteName = new_sprite_name; }
public void SetLeader(pe_UseLeaderSkillType condition, OnUseLeaderSkillDelegate callback) { UseLeaderSkillType = condition; OnUseLeaderSkill = callback; LeaderSkill = new BattleSkill(Info.TeamSkill, this, Level); }
void SetLock(pe_UseLeaderSkillType condition) { m_Grid.transform.FindChild(condition.ToString()).FindChild("lock").gameObject.SetActive(true); }