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; }
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); }
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); }
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); }
public void SetHero(DHero hero) { Hero = hero; }