Unity 框架

WebNetManager.cs 885B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Cysharp.Threading.Tasks;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using UnityEngine;
  8. using UnityEngine.Networking;
  9. namespace TFramework
  10. {
  11. public class WebNetManager : BaseManager
  12. {
  13. public int m_timeOut = 20;
  14. NetHelper net;
  15. private void Start()
  16. {
  17. net = new NetHelper(m_timeOut);
  18. }
  19. public async UniTask<CallBackArgs> SendGet(string url)
  20. {
  21. return await net.Get(url);
  22. }
  23. public async UniTask<CallBackArgs> SendPost(string url, string json, params Header[] headers)
  24. {
  25. return await net.Post(url, json, headers);
  26. }
  27. public async UniTask<CallBackArgs> SendPost(string url, WWWForm form)
  28. {
  29. return await net.Post(url, form);
  30. }
  31. }
  32. }