public void SetData(Farm_Game_RankInfo_Anw GenerateAnw) { if (GenerateAnw != null) { RankList = DataSettingManager.SetAnwData(GenerateAnw.UserInfosList); } }
public void SetData(PMsg_Plant plant) { FarmUnit fm = farms[FarmUnit.SeletedFarmID] as FarmUnit; Plant plant1; plant1 = DataSettingManager.SetAnwData(plant); GameObject plantGO = new GameObject("plant" + fm.FarmID); plantGO.transform.SetParent(fm.Renderer.transform, false); SpriteRenderer plantR = plantGO.AddComponent <SpriteRenderer>(); plant1.FarmID = FarmUnit.SeletedFarmID; plant1.Renderer = plantR; plant1.StartTime = plant.StartTime; plant1.IsSteal = plant.IsSteal; plant1.IsGrass = plant.IsGrass; plant1.IsWorm = plant.IsWorm; plant1.ID = plant.Id; fm.Plant = plant1; fm.Plant.Renderer.sortingLayerName = "plant"; fm.Plant.Renderer.sortingOrder = fm.Renderer.sortingOrder + 10; }
public void SetData(Farm_Game_SingleFriendInfo_Anw GenerateAnw) { FieldsModel.Instance.SetData(GenerateAnw.MapArrayList); ChatModel.Instance.ChatTarget = DataSettingManager.SetAnwData(GenerateAnw.OneFriendInfo); ChatModel.Instance.currentPage = 1; //ChantController.Instance.ReqChatLog(1); ChatLogManager.Instance.GetData(ChatModel.Instance.ChatTarget.UserGameId, 1); }
public void SetData(Farm_Game_FriendsInfo_Anw GenerateAnw) { Dictionary <int, PlayerInfo> temp = new Dictionary <int, PlayerInfo>(); //ActionResult = GenerateAnw.ActionResult; temp = DataSettingManager.SetAnwData(GenerateAnw.InfoList); foreach (var data in temp) { if (!playerInfos.ContainsKey(data.Key)) { playerInfos.Add(data.Key, data.Value); } else { playerInfos[data.Key] = data.Value; } } }
public static DogFood SetDogFoodAnwData(PMsg_StagePropUnit obj) { if (obj != null) { //查找本地配置表 BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(obj.Id); DogFood p = new DogFood(); p.Speedup = ba.SpeedUp; p.Url = "Sprites/DogFoods/DogFood_" + ba.Id; p.Des = ba.Des; DataSettingManager.SerializeProto(p, obj); return(p); } else { Debug.LogError(string.Format("the DogFoodObject is null")); return(null); } }
public static Elixir SetElixirAnwData(PMsg_StagePropUnit obj) { if (obj != null) { //查找本地配置表 BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(obj.Id); Elixir p = new Elixir(); //p.Url = "Sprites/Fertilizers/Fertilizer_" + ba.Id; p.StoreShowTag = 4; p.Des = ba.Des; DataSettingManager.SerializeProto(p, obj); return(p); } else { Debug.LogError(string.Format("the FertilizerObject is null")); return(null); } }
public static Result SetResultAnwData(PMsg_StagePropUnit obj) { if (obj != null) { //查找本地配置表 BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(obj.Id); Result p = new Result(); p.UpGradeToOilNum = ba.CombineCount; p.StoreShowTag = 2; p.Url = "Sprites/Results/Result_" + ba.Id; p.Des = ba.Des; DataSettingManager.SerializeProto(p, obj); return(p); } else { Debug.LogError(string.Format("the ResultObject is null")); return(null); } }
public static Seed SetSeedAnwData(PMsg_StagePropUnit obj) { if (obj != null) { //查找本地配置表 BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(obj.Id); Seed p = new Seed(); p.GrothTime = ba.GrothTime; p.StoreShowTag = 1; p.Url = "Sprites/Seeds/Seed_" + ba.Id; p.Des = ba.Des; DataSettingManager.SerializeProto(p, obj); return(p); } else { Debug.LogError(string.Format("the SeedObject is null")); return(null); } }
public static Oil SetOilAnwData(PMsg_StagePropUnit obj) { if (obj != null) { //查找本地配置表 BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(obj.Id); Oil p = new Oil(); if (ba.Type == ObjectType.PrimaryOil) { p.OilType = 1;//初级精油 ?合成数量? p.CombinCount = ba.CombineCount; p.Url = "Sprites/Oils/PrimaryOil/POil_" + ba.Id; } else if (ba.Type == ObjectType.SemiOil) { p.OilType = 2;//半成品精油 p.Url = "Sprites/Oils/SemiOil/SEOil_" + ba.Id; } else if (ba.Type == ObjectType.SeniorOil) { p.OilType = 3;//高级精油 p.Url = "Sprites/Oils/SeniorOil/SOil_" + ba.Id; } //p.GainExp = obj.GainEXP; //p.OnceLackResult = obj.OnceLackResult; p.StoreShowTag = 3; p.Des = ba.Des; DataSettingManager.SerializeProto(p, obj); return(p); } else { Debug.LogError(string.Format("the OilObject is null")); return(null); } }
//输入数据(如果当前已有改列表中id对应的物品,这刷新改物品数量信息,若数量为0,则删除该物品) public void SetData(IList <PMsg_StagePropUnit> list) { DataSettingManager.SetStoreAnwData(list); }
public void SetData(Farm_Game_MessageSend_Anw p) { MsgList = DataSettingManager.SetAnwData(p.MsgListList); }
public void SetData(Farm_Game_SearchFriend_Anw anw) { SearchList = DataSettingManager.SetAnwData(anw.SearchListList); }
/// <summary> /// 初始化地图上的所有数据 /// </summary> /// <param name="GenerateAnw"></param> public void SetData(IList <PMsg_MapUnit> GenerateAnw) { int _brandId = 1; for (int i = 0; i < GenerateAnw.Count; i++) { PMsg_MapUnit mapUnit = GenerateAnw[i]; // Debug.Log(mapUnit.Id); FarmUnit fm = farms[mapUnit.Id] as FarmUnit; fm.EnablePlant = mapUnit.EnablePlant; if (mapUnit.EnablePlant == 1 && mapUnit.Id > _brandId) { _brandId = mapUnit.Id; } fm.FarmID = mapUnit.Id; SpriteRenderer sr = fm.Renderer; int baseOder = 100 * fm.Xposi + 50 * fm.Yposi; sr.sortingLayerName = "land"; sr.sortingOrder = baseOder; //传回来的地上植物不为空 if (mapUnit.Plant.ToString() != "") { if (fm.Plant != null) { fm.Plant.ID = mapUnit.Plant.Id; fm.Plant.FarmID = fm.FarmID; fm.Plant.IsSteal = mapUnit.Plant.IsSteal; fm.Plant.StartTime = mapUnit.Plant.StartTime; fm.Plant.IsGrass = mapUnit.Plant.IsGrass; fm.Plant.IsWorm = mapUnit.Plant.IsWorm; fm.Plant.IsWater = mapUnit.Plant.IsLessWater; BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(mapUnit.Plant.Id); fm.Plant.Name = ba.Name; } else { Plant plant = DataSettingManager.SetAnwData(mapUnit.Plant); GameObject plant1 = new GameObject("plant" + fm.FarmID); plant1.transform.SetParent(fm.Renderer.transform, false); SpriteRenderer plantR = plant1.AddComponent <SpriteRenderer>(); plant.FarmID = fm.FarmID; plant.ID = mapUnit.Plant.Id; plant.IsSteal = mapUnit.Plant.IsSteal; plant.StartTime = mapUnit.Plant.StartTime; plant.Renderer = plantR; plant.IsGrass = mapUnit.Plant.IsGrass; plant.IsWorm = mapUnit.Plant.IsWorm; plant.IsWater = mapUnit.Plant.IsLessWater; fm.Plant = plant; fm.Plant.Renderer.sortingLayerName = "plant"; fm.Plant.Renderer.sortingOrder = baseOder + 10; } } else { for (int j = 0; j < fm.Go.transform.childCount; j++) { if (fm.Go.transform.GetChild(j) && fm.Go.transform.GetChild(j).name != "brand(Clone)") { GameObject.Destroy(fm.Go.transform.GetChild(j).gameObject); } } //这块地上原来有植物 if (fm.Plant != null) { fm.Plant.destroyPlant(); fm.Plant.DisposeBadIcon(); } fm.Plant = null; } } // GC.Collect(); Brand brand = Brand.Instance; brand.SelectId = _brandId + 1; }
public void SetData(Farm_Game_ChatLog_Anw p) { chatLog = DataSettingManager.SetAnwData(p.ChatListList); }