ItemProxy.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using ET;
  2. namespace GFGGame
  3. {
  4. public class ItemProxy
  5. {
  6. public static async ETTask<bool> GetItemInfos()
  7. {
  8. GameGlobal.DataInited = false;
  9. M2C_GetItemInfos response = null;
  10. response = (M2C_GetItemInfos)await MessageHelper.SendToServer(new C2M_GetItemInfos());
  11. if (response != null)
  12. {
  13. if (response.Error == ErrorCode.ERR_Success)
  14. {
  15. //物品兑换
  16. for (int i = 0; i < response.KsItemExchange.Count; i++)
  17. {
  18. ItemDataManager.InitItemExchange(response.KsItemExchange[i], response.VsItemExchange[i]);
  19. }
  20. //服装数据与物品通步
  21. DressUpMenuSuitDataManager.InitData();
  22. DressUpMenuItemDataManager.InitData();
  23. //初始化物品
  24. ItemDataManager.InitServerData(response.Items);
  25. //自定义套装
  26. CustomSuitDataManager.InitServerData(response.CustomSuits);
  27. return true;
  28. }
  29. }
  30. //!!!必须放在最后,标记数据初始化完成
  31. GameGlobal.DataInited = true;
  32. return false;
  33. }
  34. }
  35. }