Пример #1
0
    public void updateView()
    {
        _hp.text    = PlayerData.getInstance().hp + "";
        _san.text   = PlayerData.getInstance().san + "";
        _money.text = PlayerData.getInstance().money + "";

        UsableHeroInfo heroinfo = GameStaticData.getInstance().heroes [PlayerData.getInstance().heroIdx];

        for (int i = 0; i < heroinfo.talent.Length; i++)
        {
            int ii = i;
            _talents [i].onClick.Add(delegate() {
                if (heroinfo.talent [ii] == null)
                {
                    GameManager.getInstance().showDetailAmplifier("无天赋", null);
                }
                else
                {
                    GameManager.getInstance().showDetailAmplifier("talent", heroinfo.talent [ii]);
                }
            });
        }
//		for (int i = 0; i < _talents.Length; i++) {
//			_talents [i].onTouchBegin.Add (delegate() {
//				UsableHeroInfo heroinfo = GameStaticData.getInstance().heroes[PlayerData.getInstance().heroIdx]
//				GameManager.getInstance().showDetailAmplifier("减少生命上限");
//			});
//		}
        l0.RemoveChildrenToPool();
        l1.RemoveChildrenToPool();

        foreach (Potion p in PlayerData.getInstance().potions)
        {
            PotionSmall item = (PotionSmall)l0.AddItemFromPool();
            item.setInfo(p);
        }
        foreach (Scar scar in PlayerData.getInstance().scars)
        {
            ScarSmallIcon item = (ScarSmallIcon)l1.AddItemFromPool();
            item.setInfo(scar);
        }
    }
Пример #2
0
    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);
    }