[Unity] 如何解決 BestHttp出WebGL 會發生的問題

使用 BestHttp 套件後,Build WebGL ,會出現以下錯誤,


Assets/Best HTTP (Pro)/Examples/Websocket/WebSocketSample.cs(68,31): error CS1061: Type `BestHTTP.WebSocket.WebSocket' does not contain a definition for `StartPingThread' and no extension method `StartPingThread' of type `BestHTTP.WebSocket.WebSocket' could be found. Are you missing an assembly reference?


這時記得把  BestHttp 下的  WebSocketSample.cs 檔案中的68行


webSocket.StartPingThread = true;

移入到 !UNITY_WEBGL 之下, 如下圖所示

留言

這個網誌中的熱門文章

angular 如何Http 如何設定 CORS (Cross-Origin Resource Sharing)

Google Map 單車路徑計算坡度和角度小工具

Google URL Shortener API 快速教學