示例#1
0
 public UserData(DHero hero, PlayerPackage package, int gold, int coin)
 {
     Hero           = hero;
     Package        = package;
     Gold           = gold;
     Coin           = coin;
     IsChanged      = false;
     IsEquipChanged = false;
     LastAccessTime = DateTime.Now;
 }
示例#2
0
 private void GetPlayerData(G2C_Login result)
 {
     //Result = result;
     Coin    = result.Coin;
     Gold    = result.Gold;
     hero    = result.Hero;
     package = result.Package;
     operat  = SceneManager.LoadSceneAsync("Main");
     //data
     //UUIManager.Singleton.ShowMask(false);
 }
示例#3
0
        void SaveHero(long userID, DHero dHero, GameDb db)
        {
            var hero = db.TBPLayerHero.Where(t => t.UserID == userID).SingleOrDefault();

            if (hero == null)
            {
                return;
            }
            hero.Exp    = dHero.Exprices;
            hero.Equips = JsonTool.Serialize(dHero.Equips);
            hero.Level  = dHero.Level;
            hero.Magics = JsonTool.Serialize(dHero.Magics);
        }
示例#4
0
        public static DHero GetDHeroFromTBhero(DataBaseContext.TBPLayerHero i)
        {
            var hero = new DHero
            {
                HeroID   = i.HeroID,
                Exprices = i.Exp,
                Level    = i.Level
            };

            if (!string.IsNullOrEmpty(i.Equips))
            {
                hero.Equips = JsonTool.Deserialize <List <WearEquip> >(i.Equips);
            }
            if (!string.IsNullOrEmpty(i.Magics))
            {
                hero.Magics = JsonTool.Deserialize <List <HeroMagic> >(i.Magics);
            }

            return(hero);
        }
示例#5
0
 public void SetHero(DHero hero)
 {
     Hero = hero;
 }