From 406587ed82fa2f716f4732d86237d0878af333cc Mon Sep 17 00:00:00 2001 From: yinlong Date: Mon, 19 Oct 2020 17:57:18 +0800 Subject: [PATCH] fix !WebGL Platform Build Error (v2.4.5) --- Scripts/Runtime/Core/Settings.cs | 2 +- Scripts/Runtime/Implementation/WebGL/WebSocket.cs | 2 ++ Scripts/Runtime/Implementation/WebGL/WebSocketManager.cs | 6 ++++-- package.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Scripts/Runtime/Core/Settings.cs b/Scripts/Runtime/Core/Settings.cs index cd97113..d3dd503 100644 --- a/Scripts/Runtime/Core/Settings.cs +++ b/Scripts/Runtime/Core/Settings.cs @@ -7,7 +7,7 @@ public static class Settings public const string QQ_GROUP_LINK = "https://qm.qq.com/cgi-bin/qm/qr?k=KcexYJ9aYwogFXbj2aN0XHH5b2G7ICmd"; public const string EMAIL = "799329256@qq.com"; public const string AUHTOR = "psygame"; - public const string VERSION = "2.4.4"; + public const string VERSION = "2.4.5"; public const string PACKAGE_NAME = "com.psygame.unitywebsocket"; public const string UPM_URL = "https://github.com/psygame/UnityWebSocket.git"; } diff --git a/Scripts/Runtime/Implementation/WebGL/WebSocket.cs b/Scripts/Runtime/Implementation/WebGL/WebSocket.cs index 2044922..ca1caaa 100644 --- a/Scripts/Runtime/Implementation/WebGL/WebSocket.cs +++ b/Scripts/Runtime/Implementation/WebGL/WebSocket.cs @@ -1,3 +1,4 @@ +#if UNITY_EDITOR || UNITY_WEBGL using System; namespace UnityWebSocket.WebGL @@ -84,3 +85,4 @@ public void SendAsync(byte[] data) } } } +#endif \ No newline at end of file diff --git a/Scripts/Runtime/Implementation/WebGL/WebSocketManager.cs b/Scripts/Runtime/Implementation/WebGL/WebSocketManager.cs index be79e92..cc60432 100644 --- a/Scripts/Runtime/Implementation/WebGL/WebSocketManager.cs +++ b/Scripts/Runtime/Implementation/WebGL/WebSocketManager.cs @@ -1,4 +1,5 @@ -using System; +#if UNITY_EDITOR || UNITY_WEBGL +using System; using System.Collections.Generic; using System.Runtime.InteropServices; using AOT; @@ -169,4 +170,5 @@ public static string GetErrorMessageFromCode(int errorCode) } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/package.json b/package.json index 05883e0..5814325 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.psygame.unitywebsocket", "displayName": "UnityWebSocket", - "version": "2.4.4", + "version": "2.4.5", "unity": "2018.3", "description": "The Best Unity WebSocket Plugin for All Platforms.", "keywords": [