ClothingSyntheticSProxy.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using ET;
  6. namespace GFGGame
  7. {
  8. public class ClothingSyntheticSProxy
  9. {
  10. public static async ETTask<bool> ClothtingSynthetic(int itemId)
  11. {
  12. var response = (M2C_ClothingSynthetic)await MessageHelper.SendToServer(new C2M_ClothingSynthetic() { ItemId = itemId });
  13. if (response != null)
  14. {
  15. if (response.Error == ErrorCode.ERR_Success)
  16. {
  17. GetSuitItemController.TryShow(itemId);
  18. return true;
  19. }
  20. }
  21. return true;
  22. }
  23. public static async ETTask<bool> CardSynthetic(int itemId)
  24. {
  25. var response = (M2C_CardSynthetic)await MessageHelper.SendToServer(new C2M_CardSynthetic() { ItemId = itemId });
  26. if (response != null)
  27. {
  28. if (response.Error == ErrorCode.ERR_Success)
  29. {
  30. ItemCfg itemcfg = ItemCfgArray.Instance.GetCfg(itemId);
  31. if(itemcfg.subType == 5)
  32. {
  33. ViewManager.Show<LuckyBoxNewCardView>(itemId);
  34. }
  35. else
  36. {
  37. int[][] array = new int[][]
  38. {
  39. new int[] { itemId, 1 }
  40. };
  41. BonusController.TryShowBonusList(array);
  42. }
  43. return true;
  44. }
  45. }
  46. return true;
  47. }
  48. }
  49. }