From 0049ec1dd311cf63cf65b40b310c974ef896f151 Mon Sep 17 00:00:00 2001 From: insthync Date: Tue, 22 Oct 2024 19:24:44 +0700 Subject: [PATCH] feat: exclude from server build --- plugins/WebViewObject.cs | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/plugins/WebViewObject.cs b/plugins/WebViewObject.cs index 98a13a1a..01c826e0 100644 --- a/plugins/WebViewObject.cs +++ b/plugins/WebViewObject.cs @@ -616,7 +616,7 @@ public bool IsInitialized() #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED return true; -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED return true; #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE @@ -670,7 +670,7 @@ public void Init( #endif #elif UNITY_WEBPLAYER Application.ExternalCall("unityWebView.init", name); -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED Debug.LogError("Webview is not supported on this platform."); #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX @@ -722,7 +722,7 @@ protected virtual void OnDestroy() #endif #elif UNITY_WEBPLAYER Application.ExternalCall("unityWebView.destroy", name); -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX if (bg != null) { @@ -751,7 +751,7 @@ public void Pause() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX //TODO: UNSUPPORTED @@ -771,7 +771,7 @@ public void Resume() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX //TODO: UNSUPPORTED @@ -791,7 +791,7 @@ public void SetCenterPositionWithScale(Vector2 center, Vector2 scale) { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #else float left = (Screen.width - scale.x) / 2.0f + center.x; @@ -804,7 +804,7 @@ public void SetCenterPositionWithScale(Vector2 center, Vector2 scale) public void SetMargins(int left, int top, int right, int bottom, bool relative = false) { -#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED return; #elif UNITY_WEBPLAYER || UNITY_WEBGL @@ -825,7 +825,7 @@ public void SetMargins(int left, int top, int right, int bottom, bool relative = mMarginBottom = bottom; mMarginRelative = relative; float ml, mt, mr, mb; -#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_WEBPLAYER || UNITY_WEBGL ml = left; @@ -903,7 +903,7 @@ public void SetMargins(int left, int top, int right, int bottom, bool relative = mMarginBottomComputed = mb; mMarginRelativeComputed = r; -#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_WEBPLAYER Application.ExternalCall("unityWebView.setMargins", name, (int)ml, (int)mt, (int)mr, (int)mb); @@ -940,7 +940,7 @@ public void SetVisibility(bool v) #endif #elif UNITY_WEBPLAYER Application.ExternalCall("unityWebView.setVisibility", name, v); -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX if (webView == IntPtr.Zero) @@ -1077,7 +1077,7 @@ public bool SetURLPattern(string allowPattern, string denyPattern, string hookPa #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED return false; -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED return false; #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE @@ -1101,7 +1101,7 @@ public void LoadURL(string url) #endif #elif UNITY_WEBPLAYER Application.ExternalCall("unityWebView.loadURL", name, url); -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1122,7 +1122,7 @@ public void LoadHTML(string html, string baseUrl) baseUrl = ""; #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1143,7 +1143,7 @@ public void EvaluateJS(string js) #endif #elif UNITY_WEBPLAYER Application.ExternalCall("unityWebView.evaluateJS", name, js); -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1161,7 +1161,7 @@ public int Progress() #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED return 0; -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED return 0; #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE @@ -1180,7 +1180,7 @@ public bool CanGoBack() #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED return false; -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED return false; #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE @@ -1199,7 +1199,7 @@ public bool CanGoForward() #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED return false; -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED return false; #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE @@ -1217,7 +1217,7 @@ public void GoBack() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1234,7 +1234,7 @@ public void GoForward() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1251,7 +1251,7 @@ public void Reload() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1338,7 +1338,7 @@ public void AddCustomHeader(string headerKey, string headerValue) { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1356,7 +1356,7 @@ public string GetCustomHeaderValue(string headerKey) #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED return null; -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED return null; #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE @@ -1373,7 +1373,7 @@ public string GetCustomHeaderValue(string headerKey) public void RemoveCustomHeader(string headerKey) { #if UNITY_WEBPLAYER || UNITY_WEBGL -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) return; @@ -1389,7 +1389,7 @@ public void ClearCustomHeader() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1406,7 +1406,7 @@ public void ClearCookies() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1424,7 +1424,7 @@ public void SaveCookies() { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1442,7 +1442,7 @@ public void GetCookies(string url) { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE if (webView == IntPtr.Zero) @@ -1461,7 +1461,7 @@ public void SetBasicAuthInfo(string userName, string password) { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX //TODO: UNSUPPORTED @@ -1480,7 +1480,7 @@ public void ClearCache(bool includeDiskFiles) { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_IPHONE && !UNITY_EDITOR if (webView == IntPtr.Zero) @@ -1498,7 +1498,7 @@ public void SetTextZoom(int textZoom) { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_IPHONE && !UNITY_EDITOR //TODO: UNSUPPORTED @@ -1513,7 +1513,7 @@ public void SetMixedContentMode(int mode) // 0: MIXED_CONTENT_ALWAYS_ALLOW, 1: { #if UNITY_WEBPLAYER || UNITY_WEBGL //TODO: UNSUPPORTED -#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX +#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_LINUX || UNITY_SERVER //TODO: UNSUPPORTED #elif UNITY_IPHONE && !UNITY_EDITOR //TODO: UNSUPPORTED