protected override void OnShown() { if (contentType == "scar") { Scar scar = (Scar)content; _pic.url = "image/Scar/" + scar.scarId; ScarStaticInfo sinfo = GameStaticData.getInstance().getScarInfo(scar.scarId); _name.text = sinfo.scarName; _desp.text = sinfo.scarDesp; } else if (contentType == "potion") { Potion potion = (Potion)content; _pic.url = "image/Potion/" + potion.pid; PotionStaticInfo pinfo = GameStaticData.getInstance().getPotionInfo(potion.pid); _name.text = pinfo.pname; _desp.text = pinfo.pname; } else if (contentType == "talent") { HeroTalent talent = (HeroTalent)content; _pic.url = "image/Talent/" + talent.talentId; _name.text = GameStaticData.getInstance().talents[int.Parse(talent.talentId)].talentName; _desp.text = GameStaticData.getInstance().talents[int.Parse(talent.talentId)].talentDesp; } else if (contentType == "tower_skill") { SkillState skill = (SkillState)content; _pic.url = "image/TowerSkill/" + skill.skillId; _name.text = GameStaticData.getInstance().getTowerSkillInfo(skill.skillId).skillName; _desp.text = GameStaticData.getInstance().getTowerSkillInfo(skill.skillId).skillDesp; } //_pic.url = ""; }
public void initHeroes() { { HeroTalent talent = new HeroTalent(); talent.talentId = "00"; talent.talentName = "Strong"; talent.talentDesp = "You are so strong, that all your melee towers will cause 10% more damage."; talents.Add(talent); } { HeroTalent talent = new HeroTalent(); talent.talentId = "01"; talent.talentName = "Continuation"; talent.talentDesp = "You will come back."; talents.Add(talent); } { HeroTalent talent = new HeroTalent(); talent.talentId = "02"; talent.talentName = "Shield"; talent.talentDesp = "Bugs will not hurt you."; talents.Add(talent); } { HeroTalent talent = new HeroTalent(); talent.talentId = "03"; talent.talentName = "Steal Will"; talent.talentDesp = "No one can destory your will."; talents.Add(talent); } UsableHeroInfo h1 = new UsableHeroInfo(); h1.name = "Soldier"; h1.desp = "He is a soldier.\nHe is pretty strong and fearless.\nHe is good at battle."; h1.maxHp = 100; h1.maxMp = 20; h1.talent [0] = talents[0]; h1.talent [1] = talents[1]; h1.talent [2] = talents[2]; UsableHeroInfo h2 = new UsableHeroInfo(); h2.name = "Wizard"; h2.desp = "He is a powerful wizard with strong will and fragile body.\nHe can use magic to play his enemy.\nHe is used to darkness."; h2.maxHp = 100; h2.maxMp = 20; h2.talent [0] = talents[0]; h2.talent [1] = talents[0]; h2.talent [2] = talents[0]; UsableHeroInfo h3 = new UsableHeroInfo(); h3.name = "Scavenger"; h3.desp = "He is searching for something.\nHe is good at protect himself.\nHe is an sb."; h3.maxHp = 100; h3.maxMp = 20; h3.talent [0] = talents[3]; h2.talent [1] = talents[3]; h2.talent [2] = talents[3]; heroes.Add(h1); heroes.Add(h2); heroes.Add(h3); }