三国卡牌客户端基础资源仓库
yyl
2026-03-31 53eabc0501bb1df659761c8c5979fc5c60bbbb79
Assets/Launch/HttpRequest/HttpBehaviour.cs
@@ -36,11 +36,18 @@
        public static void Create(string _url, string _method, string _content, string _contentType, int _retry = 3, Action<bool, string> _result = null)
        {
#if UNITY_WEBGL
            // WebGL请使用CreateAsync
            Debug.LogWarning("[HttpBehaviour] Create() 不支持WebGL,请使用CreateAsync()");
            _result?.Invoke(false, "WebGL不支持HttpWebRequest");
            return;
#else
            var carrier = new GameObject();
            GameObject.DontDestroyOnLoad(carrier);
            carrier.hideFlags = HideFlags.HideInHierarchy;
            var behaviour = carrier.AddComponent<HttpBehaviour>();
            behaviour.Begin(_url, _method, _content, _contentType, _retry, _result);
#endif
        }
        /// <summary>