Beispiel #1
0
 static int SetHeroData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         HeroItem      obj  = (HeroItem)ToLua.CheckObject(L, 1, typeof(HeroItem));
         HeroTableData arg0 = (HeroTableData)ToLua.CheckObject(L, 2, typeof(HeroTableData));
         obj.SetHeroData(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #2
0
    public override void Refresh()
    {
        base.Refresh();
        foreach (HeroInfo hero in Gamedata.me.userinfo.HeroList)
        {
            HeroItem heroItem = AddHero(ref OwnedHeros, ref ownedHeroCount);
            heroItem.SetHeroInfo(hero);
        }

        HeroTableData[] heros = Database.me.GetAll <HeroTableData>();
        foreach (HeroTableData hero in heros)
        {
            HeroItem heroItem = AddHero(ref NotOwnedHeros, ref notOwnedHeroCount);
            heroItem.SetHeroData(hero);
        }
    }