From 53eabc0501bb1df659761c8c5979fc5c60bbbb79 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期二, 31 三月 2026 19:47:04 +0800
Subject: [PATCH] webgl
---
Assets/Launch/HttpRequest/HttpBehaviour.cs | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Assets/Launch/HttpRequest/HttpBehaviour.cs b/Assets/Launch/HttpRequest/HttpBehaviour.cs
index 45f11d9..680d68a 100644
--- a/Assets/Launch/HttpRequest/HttpBehaviour.cs
+++ b/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璇蜂娇鐢–reateAsync
+ Debug.LogWarning("[HttpBehaviour] Create() 涓嶆敮鎸乄ebGL锛岃浣跨敤CreateAsync()");
+ _result?.Invoke(false, "WebGL涓嶆敮鎸丠ttpWebRequest");
+ 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>
--
Gitblit v1.8.0