├── .gitignore ├── LICENSE ├── README.md ├── appendix └── sample-sfsafariviewcontroller-chromecustomtabs │ ├── .gitignore │ ├── Assets │ ├── Main.cs │ ├── Main.cs.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── Android.meta │ │ ├── Android │ │ │ ├── com.android.support.customtabs-23.0.0.aar │ │ │ ├── com.android.support.customtabs-23.0.0.aar.meta │ │ │ ├── com.android.support.support-annotations-23.0.0.jar │ │ │ └── com.android.support.support-annotations-23.0.0.jar.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── Dependencies.xml │ │ │ └── Dependencies.xml.meta │ │ ├── iOS.meta │ │ └── iOS │ │ │ ├── SafariView.mm │ │ │ └── SafariView.mm.meta │ ├── Scenes.meta │ └── Scenes │ │ ├── SampleScene.unity │ │ └── SampleScene.unity.meta │ ├── Packages │ ├── com.google.external-dependency-manager-1.2.165.tgz │ ├── manifest.json │ └── packages-lock.json │ ├── ProjectSettings │ ├── AndroidResolverDependencies.xml │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── GvhProjectSettings.xml │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ └── XRSettings.asset │ └── README.md ├── build ├── .gitignore ├── Packager │ └── Assets │ │ └── Editor │ │ └── Packager.cs └── Rakefile ├── dist ├── package-nofragment │ ├── Assets.meta │ ├── Assets │ │ ├── Plugins.meta │ │ ├── Plugins │ │ │ ├── Android.meta │ │ │ ├── Android │ │ │ │ ├── WebViewPlugin-development.aar.tmpl │ │ │ │ ├── WebViewPlugin-development.aar.tmpl.meta │ │ │ │ ├── WebViewPlugin-release.aar.tmpl │ │ │ │ └── WebViewPlugin-release.aar.tmpl.meta │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── UnityWebViewPostprocessBuild.cs │ │ │ │ └── UnityWebViewPostprocessBuild.cs.meta │ │ │ ├── WebView.bundle.meta │ │ │ ├── WebView.bundle │ │ │ │ ├── Contents.meta │ │ │ │ └── Contents │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── Info.plist.meta │ │ │ │ │ ├── MacOS.meta │ │ │ │ │ ├── MacOS │ │ │ │ │ ├── WebView │ │ │ │ │ └── WebView.meta │ │ │ │ │ ├── Resources.meta │ │ │ │ │ ├── Resources │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ └── InfoPlist.strings.meta │ │ │ │ │ ├── _CodeSignature.meta │ │ │ │ │ └── _CodeSignature │ │ │ │ │ ├── CodeResources │ │ │ │ │ └── CodeResources.meta │ │ │ ├── WebViewObject.cs │ │ │ ├── WebViewObject.cs.meta │ │ │ ├── iOS.meta │ │ │ ├── iOS │ │ │ │ ├── WebView.mm │ │ │ │ ├── WebView.mm.meta │ │ │ │ ├── WebViewWithUIWebView.mm │ │ │ │ └── WebViewWithUIWebView.mm.meta │ │ │ ├── unity-webview-webgl-plugin.jslib │ │ │ └── unity-webview-webgl-plugin.jslib.meta │ │ ├── WebGLTemplates.meta │ │ ├── WebGLTemplates │ │ │ ├── unity-webview-2020.meta │ │ │ ├── unity-webview-2020 │ │ │ │ ├── index.html │ │ │ │ ├── index.html.meta │ │ │ │ ├── unity-webview.js │ │ │ │ └── unity-webview.js.meta │ │ │ ├── unity-webview.meta │ │ │ └── unity-webview │ │ │ │ ├── index.html │ │ │ │ ├── index.html.meta │ │ │ │ ├── unity-webview.js │ │ │ │ └── unity-webview.js.meta │ │ ├── WebPlayerTemplates.meta │ │ └── WebPlayerTemplates │ │ │ ├── unity-webview.meta │ │ │ └── unity-webview │ │ │ ├── index.html │ │ │ ├── index.html.meta │ │ │ ├── thumbnail.png │ │ │ ├── thumbnail.png.meta │ │ │ ├── unity-webview.js │ │ │ └── unity-webview.js.meta │ ├── package.json │ ├── package.json.meta │ ├── unity-webview.asmdef │ └── unity-webview.asmdef.meta ├── package │ ├── Assets.meta │ ├── Assets │ │ ├── Plugins.meta │ │ ├── Plugins │ │ │ ├── Android.meta │ │ │ ├── Android │ │ │ │ ├── WebViewPlugin-development.aar.tmpl │ │ │ │ ├── WebViewPlugin-development.aar.tmpl.meta │ │ │ │ ├── WebViewPlugin-release.aar.tmpl │ │ │ │ ├── WebViewPlugin-release.aar.tmpl.meta │ │ │ │ ├── core-1.6.0.aar.tmpl │ │ │ │ └── core-1.6.0.aar.tmpl.meta │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── UnityWebViewPostprocessBuild.cs │ │ │ │ └── UnityWebViewPostprocessBuild.cs.meta │ │ │ ├── WebView.bundle.meta │ │ │ ├── WebView.bundle │ │ │ │ ├── Contents.meta │ │ │ │ └── Contents │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── Info.plist.meta │ │ │ │ │ ├── MacOS.meta │ │ │ │ │ ├── MacOS │ │ │ │ │ ├── WebView │ │ │ │ │ └── WebView.meta │ │ │ │ │ ├── Resources.meta │ │ │ │ │ ├── Resources │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ └── InfoPlist.strings.meta │ │ │ │ │ ├── _CodeSignature.meta │ │ │ │ │ └── _CodeSignature │ │ │ │ │ ├── CodeResources │ │ │ │ │ └── CodeResources.meta │ │ │ ├── WebViewObject.cs │ │ │ ├── WebViewObject.cs.meta │ │ │ ├── iOS.meta │ │ │ ├── iOS │ │ │ │ ├── WebView.mm │ │ │ │ ├── WebView.mm.meta │ │ │ │ ├── WebViewWithUIWebView.mm │ │ │ │ └── WebViewWithUIWebView.mm.meta │ │ │ ├── unity-webview-webgl-plugin.jslib │ │ │ └── unity-webview-webgl-plugin.jslib.meta │ │ ├── WebGLTemplates.meta │ │ ├── WebGLTemplates │ │ │ ├── unity-webview-2020.meta │ │ │ ├── unity-webview-2020 │ │ │ │ ├── index.html │ │ │ │ ├── index.html.meta │ │ │ │ ├── unity-webview.js │ │ │ │ └── unity-webview.js.meta │ │ │ ├── unity-webview.meta │ │ │ └── unity-webview │ │ │ │ ├── index.html │ │ │ │ ├── index.html.meta │ │ │ │ ├── unity-webview.js │ │ │ │ └── unity-webview.js.meta │ │ ├── WebPlayerTemplates.meta │ │ └── WebPlayerTemplates │ │ │ ├── unity-webview.meta │ │ │ └── unity-webview │ │ │ ├── index.html │ │ │ ├── index.html.meta │ │ │ ├── thumbnail.png │ │ │ ├── thumbnail.png.meta │ │ │ ├── unity-webview.js │ │ │ └── unity-webview.js.meta │ ├── package.json │ ├── package.json.meta │ ├── unity-webview.asmdef │ └── unity-webview.asmdef.meta ├── unity-webview-nofragment.unitypackage ├── unity-webview-nofragment.zip ├── unity-webview.unitypackage └── unity-webview.zip ├── plugins ├── Android │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── install.sh │ ├── settings.gradle │ ├── webview-nofragment │ │ ├── build.gradle │ │ ├── consumer-rules.pro │ │ ├── libs │ │ │ └── .gitkeep │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── net │ │ │ └── gree │ │ │ └── unitywebview │ │ │ ├── CUnityPlayer.java │ │ │ ├── CUnityPlayerActivity.java │ │ │ ├── CWebViewPlugin.java │ │ │ └── RoundedWebView.java │ └── webview │ │ ├── build.gradle │ │ ├── consumer-rules.pro │ │ ├── libs-ext │ │ └── core-1.6.0.aar │ │ ├── libs │ │ └── .gitkeep │ │ ├── proguard-rules.pro │ │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── net │ │ └── gree │ │ └── unitywebview │ │ ├── CUnityPlayer.java │ │ ├── CUnityPlayerActivity.java │ │ ├── CWebViewPlugin.java │ │ └── RoundedWebView.java ├── Editor │ └── UnityWebViewPostprocessBuild.cs ├── Mac │ ├── .gitignore │ ├── Resources │ │ ├── Info-WebViewSeparated.plist │ │ ├── Info.plist │ │ ├── InfoPlist.strings │ │ └── Prefix.pch │ ├── Sources │ │ └── WebView.mm │ ├── WebView.bundle.meta │ ├── WebView.xcodeproj │ │ └── project.pbxproj │ └── install.sh ├── WebGLTemplates │ ├── unity-webview-2020 │ │ ├── index.html │ │ └── unity-webview.js │ └── unity-webview │ │ ├── index.html │ │ └── unity-webview.js ├── WebPlayerTemplates │ └── unity-webview │ │ ├── index.html │ │ ├── thumbnail.png │ │ └── unity-webview.js ├── WebViewObject.cs ├── iOS │ ├── WebView.mm │ └── WebViewWithUIWebView.mm └── unity-webview-webgl-plugin.jslib └── sample ├── .gitignore ├── Assets ├── Animations.meta ├── Animations │ ├── Pop.anim │ └── Pop.anim.meta ├── Sample.unity ├── Sample.unity.meta ├── Scripts.meta ├── Scripts │ ├── SampleCustomHeader.cs │ ├── SampleCustomHeader.cs.meta │ ├── SampleWebView.cs │ └── SampleWebView.cs.meta ├── StreamingAssets.meta └── StreamingAssets │ ├── sample.html │ ├── sample.html.meta │ ├── sample.jpg │ ├── sample.jpg.meta │ ├── sample.js │ └── sample.js.meta └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset /.gitignore: -------------------------------------------------------------------------------- 1 | Library 2 | Temp 3 | *.csproj 4 | *.sln 5 | *.pidb 6 | *.userprefs 7 | **/*.xcodeproj/* 8 | !**/*.xcodeproj/project.pbxproj 9 | !**/*.xcworkspace/contents.xcworkspacedata 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The zlib License 2 | ------------------------------------- 3 | Copyright (C) 2011 Keijiro Takahashi 4 | Copyright (C) 2012 GREE, Inc. 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Asset meta data should only be ignored when the corresponding asset is also ignored 18 | !/[Aa]ssets/**/*.meta 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | 63 | # Crashlytics generated file 64 | crashlytics-build.properties 65 | 66 | # Packed Addressables 67 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 68 | 69 | # Temporary auto-generated Android Assets 70 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 71 | /[Aa]ssets/[Ss]treamingAssets/aa/* 72 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Main.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | using UnityEngine; 5 | 6 | // cf. https://qiita.com/lucifuges/items/b17d602417a9a249689f 7 | 8 | public class Main : MonoBehaviour 9 | { 10 | // Start is called before the first frame update 11 | void Start() 12 | { 13 | 14 | } 15 | 16 | // Update is called once per frame 17 | void Update() 18 | { 19 | 20 | } 21 | 22 | void OnGUI() 23 | { 24 | if (GUI.Button(new Rect(10, 10, 150, 100), "Open")) { 25 | LaunchURL("https://www.google.com"); 26 | } 27 | } 28 | 29 | #if UNITY_EDITOR 30 | #elif UNITY_ANDROID 31 | #elif UNITY_IOS 32 | [DllImport("__Internal")] 33 | static extern void launchURL(string url); 34 | #endif 35 | 36 | void LaunchURL(string url) 37 | { 38 | #if UNITY_EDITOR 39 | Application.OpenURL(url); 40 | #elif UNITY_ANDROID 41 | using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) 42 | using (var activity = unityPlayer.GetStatic("currentActivity")) 43 | using (var intentBuilder = new AndroidJavaObject("android.support.customtabs.CustomTabsIntent$Builder")) 44 | using (var intent = intentBuilder.Call("build")) 45 | using (var uriClass = new AndroidJavaClass("android.net.Uri")) 46 | using (var uri = uriClass.CallStatic("parse", url)) 47 | intent.Call("launchUrl", activity, uri); 48 | #elif UNITY_IOS 49 | launchURL(url); 50 | #endif 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Main.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad288d988aec04798b370acfd4bdd21e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9e30acb017844291b95c386d9c63a0e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd3cbab1af89d4563a714d9236d04138 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Android/com.android.support.customtabs-23.0.0.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Android/com.android.support.customtabs-23.0.0.aar -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Android/com.android.support.customtabs-23.0.0.aar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78d1747c224aa4da6bbda943b0a7afa2 3 | labels: 4 | - gpsr 5 | PluginImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | defineConstraints: [] 11 | isPreloaded: 0 12 | isOverridable: 0 13 | isExplicitlyReferenced: 0 14 | validateReferences: 1 15 | platformData: 16 | - first: 17 | Android: Android 18 | second: 19 | enabled: 1 20 | settings: {} 21 | - first: 22 | Any: 23 | second: 24 | enabled: 0 25 | settings: {} 26 | - first: 27 | Editor: Editor 28 | second: 29 | enabled: 0 30 | settings: 31 | DefaultValueInitialized: true 32 | userData: 33 | assetBundleName: 34 | assetBundleVariant: 35 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Android/com.android.support.support-annotations-23.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Android/com.android.support.support-annotations-23.0.0.jar -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Android/com.android.support.support-annotations-23.0.0.jar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed60d3aa167e249fd9f5af76fab03bc2 3 | labels: 4 | - gpsr 5 | PluginImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | defineConstraints: [] 11 | isPreloaded: 0 12 | isOverridable: 0 13 | isExplicitlyReferenced: 0 14 | validateReferences: 1 15 | platformData: 16 | - first: 17 | Android: Android 18 | second: 19 | enabled: 1 20 | settings: {} 21 | - first: 22 | Any: 23 | second: 24 | enabled: 0 25 | settings: {} 26 | - first: 27 | Editor: Editor 28 | second: 29 | enabled: 0 30 | settings: 31 | DefaultValueInitialized: true 32 | userData: 33 | assetBundleName: 34 | assetBundleVariant: 35 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e96e8afec47dd4d598e61b91b1c1632f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Editor/Dependencies.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/Editor/Dependencies.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e541f418ea6c444f49eb45cd89eaf46a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1ce05261902b4536a64eedc87ee6d8d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/iOS/SafariView.mm: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | extern UIViewController* UnityGetGLViewController(); 4 | 5 | extern "C" 6 | { 7 | void launchURL(const char *url) 8 | { 9 | UIViewController *uvc = UnityGetGLViewController(); 10 | NSURL *URL = [NSURL URLWithString:[[NSString alloc] initWithUTF8String:url]]; 11 | SFSafariViewController *sfvc = [[SFSafariViewController alloc] initWithURL:URL]; 12 | [uvc presentViewController:sfvc animated:YES completion:nil]; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Plugins/iOS/SafariView.mm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3998dc8c6941744fa86b3618720c28ba 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: x86 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 1 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: SafariServices; 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6aa978d467bc84e6aadcd71ea7ebe442 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Packages/com.google.external-dependency-manager-1.2.165.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/appendix/sample-sfsafariviewcontroller-chromecustomtabs/Packages/com.google.external-dependency-manager-1.2.165.tgz -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.google.external-dependency-manager": "file:com.google.external-dependency-manager-1.2.165.tgz", 4 | "com.unity.collab-proxy": "1.3.9", 5 | "com.unity.ide.rider": "2.0.7", 6 | "com.unity.ide.visualstudio": "2.0.7", 7 | "com.unity.ide.vscode": "1.2.3", 8 | "com.unity.test-framework": "1.1.24", 9 | "com.unity.textmeshpro": "3.0.4", 10 | "com.unity.timeline": "1.4.7", 11 | "com.unity.ugui": "1.0.0", 12 | "com.unity.modules.ai": "1.0.0", 13 | "com.unity.modules.androidjni": "1.0.0", 14 | "com.unity.modules.animation": "1.0.0", 15 | "com.unity.modules.assetbundle": "1.0.0", 16 | "com.unity.modules.audio": "1.0.0", 17 | "com.unity.modules.cloth": "1.0.0", 18 | "com.unity.modules.director": "1.0.0", 19 | "com.unity.modules.imageconversion": "1.0.0", 20 | "com.unity.modules.imgui": "1.0.0", 21 | "com.unity.modules.jsonserialize": "1.0.0", 22 | "com.unity.modules.particlesystem": "1.0.0", 23 | "com.unity.modules.physics": "1.0.0", 24 | "com.unity.modules.physics2d": "1.0.0", 25 | "com.unity.modules.screencapture": "1.0.0", 26 | "com.unity.modules.terrain": "1.0.0", 27 | "com.unity.modules.terrainphysics": "1.0.0", 28 | "com.unity.modules.tilemap": "1.0.0", 29 | "com.unity.modules.ui": "1.0.0", 30 | "com.unity.modules.uielements": "1.0.0", 31 | "com.unity.modules.umbra": "1.0.0", 32 | "com.unity.modules.unityanalytics": "1.0.0", 33 | "com.unity.modules.unitywebrequest": "1.0.0", 34 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 35 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 36 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 37 | "com.unity.modules.unitywebrequestwww": "1.0.0", 38 | "com.unity.modules.vehicles": "1.0.0", 39 | "com.unity.modules.video": "1.0.0", 40 | "com.unity.modules.vr": "1.0.0", 41 | "com.unity.modules.wind": "1.0.0", 42 | "com.unity.modules.xr": "1.0.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/AndroidResolverDependencies.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.android.support:customtabs:23.0.0 4 | 5 | 6 | Assets/Plugins/Android/com.android.support.customtabs-23.0.0.aar 7 | Assets/Plugins/Android/com.android.support.support-annotations-23.0.0.jar 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/GvhProjectSettings.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2020.3.8f1 2 | m_EditorVersionWithRevision: 2020.3.8f1 (507919d4fff5) 3 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /appendix/sample-sfsafariviewcontroller-chromecustomtabs/README.md: -------------------------------------------------------------------------------- 1 | # sample-sfsafariviewcontroller-chromecustomtabs 2 | 3 | This sample app shows a simple usage of SFSafariViewController/Chrome Custom Tabs based on https://qiita.com/lucifuges/items/b17d602417a9a249689f . This app does **not** utilize the unity-webview plugin. The unity-webview plugin's various functions depend on UIWebView/WKWebView/WebView and cannot be covered by SFSafariViewController/Chrome Custom Tabs. I however made this app and put it here as SFSafariViewController/Chrome Custom Tabs can be more adequate for some applications and I cannot find any other simple sample code. 4 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | Packager/Assets/Plugins 2 | Packager/Library 3 | -------------------------------------------------------------------------------- /build/Packager/Assets/Editor/Packager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 GREE, Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | using UnityEditor; 24 | using UnityEngine; 25 | using System; 26 | 27 | public class Packager 28 | { 29 | public static void Export() 30 | { 31 | AssetDatabase.ExportPackage( 32 | new string[]{"Assets/Plugins", "Assets/WebGLTemplates", "Assets/WebPlayerTemplates"}, 33 | "unity-webview.unitypackage", 34 | ExportPackageOptions.Recurse); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /build/Rakefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 GREE, Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | require 'fileutils' 22 | 23 | UNITY="/Applications/Unity/Hub/Editor/2019.4.40f1/Unity.app/Contents/MacOS/Unity" 24 | 25 | CNT = 2 26 | SRCDIR = Array.new(CNT); 27 | DSTDIR = Array.new(CNT); 28 | SRCS = Array.new(CNT); 29 | 30 | SRCDIR[0]="../plugins" 31 | DSTDIR[0]="Packager/Assets/Plugins" 32 | SRCS[0]=%W| 33 | Editor/UnityWebViewPostprocessBuild.cs 34 | WebViewObject.cs 35 | iOS/WebView.mm 36 | iOS/WebViewWithUIWebView.mm 37 | unity-webview-webgl-plugin.jslib 38 | | 39 | SRCDIR[1]="../plugins" 40 | DSTDIR[1]="Packager/Assets" 41 | SRCS[1]=%W| 42 | WebGLTemplates 43 | WebPlayerTemplates 44 | | 45 | 46 | task :default => ["build", "pack", "buildnofragment", "packnofragment"] 47 | 48 | desc "build" 49 | task :build do 50 | DSTDIR.each do |dir| 51 | sh "git clean -dxf ." 52 | end 53 | # for keeping meta files 54 | if Dir.exists?('../dist/package') 55 | sh "cd ../dist/package; git clean -dxf .; git checkout ." 56 | sh "cp -a ../dist/package/* Packager" 57 | end 58 | CNT.times do |i| 59 | SRCS[i].each do |src| 60 | dstdir = "#{DSTDIR[i]}/#{File.dirname(src)}" 61 | FileUtils.mkdir_p dstdir 62 | FileUtils.cp_r "#{SRCDIR[i]}/#{src}", dstdir, preserve:true 63 | end 64 | end 65 | ["Android"].each do |t| 66 | Dir.chdir("#{SRCDIR[0]}/#{t}") do 67 | sh "git clean -dxf .; ./install.sh" 68 | sh "git clean -dxf .; ./install.sh --development" 69 | end 70 | end 71 | ["Mac"].each do |t| 72 | Dir.chdir("#{SRCDIR[0]}/#{t}") do 73 | sh "./install.sh" 74 | end 75 | end 76 | end 77 | 78 | desc "pack" 79 | task :pack do 80 | sh "#{UNITY} -projectPath `pwd`/Packager -batchmode -quit -executeMethod Packager.Export -logFile LOG" 81 | FileUtils.mv "Packager/unity-webview.unitypackage", "../dist" 82 | sh "(cd Packager; rm -f ../../dist/unity-webview.zip; zip -qr9 ../../dist/unity-webview.zip `find Assets/Plugins -type f` `find Assets/WebGLTemplates -type f` `find Assets/WebPlayerTemplates -type f`)" 83 | sh "(cd ../dist/package; rm -rf Assets; unzip -q ../unity-webview.zip; git checkout Assets/Plugins.meta; git checkout Assets/WebGLTemplates.meta; git checkout Assets/WebPlayerTemplates.meta)" 84 | end 85 | 86 | desc "buildnofragment" 87 | task :buildnofragment do 88 | DSTDIR.each do |dir| 89 | sh "git clean -dxf ." 90 | end 91 | # for keeping meta files 92 | if Dir.exist?('../dist/package-nofragment') 93 | sh "cd ../dist/package-nofragment; git clean -dxf .; git checkout ." 94 | sh "cp -a ../dist/package-nofragment/* Packager" 95 | end 96 | CNT.times do |i| 97 | SRCS[i].each do |src| 98 | dstdir = "#{DSTDIR[i]}/#{File.dirname(src)}" 99 | FileUtils.mkdir_p dstdir 100 | FileUtils.cp_r "#{SRCDIR[i]}/#{src}", dstdir, preserve:true 101 | end 102 | end 103 | ["Android"].each do |t| 104 | Dir.chdir("#{SRCDIR[0]}/#{t}") do 105 | sh "git clean -dxf .; ./install.sh --nofragment" 106 | sh "git clean -dxf .; ./install.sh --nofragment --development" 107 | end 108 | end 109 | ["Mac"].each do |t| 110 | Dir.chdir("#{SRCDIR[0]}/#{t}") do 111 | sh "./install.sh" 112 | end 113 | end 114 | sh "sed -i '' -e 's/private static bool nofragment = false/private static bool nofragment = true/' Packager/Assets/Plugins/Editor/UnityWebViewPostprocessBuild.cs" 115 | end 116 | 117 | desc "packnofragment" 118 | task :packnofragment do 119 | sh "#{UNITY} -projectPath `pwd`/Packager -batchmode -quit -executeMethod Packager.Export -logFile LOG" 120 | FileUtils.mv "Packager/unity-webview.unitypackage", "../dist/unity-webview-nofragment.unitypackage" 121 | sh "(cd Packager; rm -f ../../dist/unity-webview-nofragment.zip; zip -qr9 ../../dist/unity-webview-nofragment.zip `find Assets/Plugins -type f` `find Assets/WebGLTemplates -type f` `find Assets/WebPlayerTemplates -type f`)" 122 | sh "(cd ../dist/package-nofragment; rm -rf Assets; unzip -q ../unity-webview-nofragment.zip; git checkout Assets/Plugins.meta; git checkout Assets/WebGLTemplates.meta; git checkout Assets/WebPlayerTemplates.meta)" 123 | end 124 | 125 | desc "commit" 126 | task :commit do 127 | rev = open("|git show HEAD|head -1|awk '{print $2}'").read.strip 128 | sh "git add ../dist" 129 | sh "git commit -m 'updated binaries (#{rev}).'" 130 | end 131 | 132 | desc "clean" 133 | task :clean do 134 | DSTDIR.each do |dir| 135 | FileUtils.rm_rf dir 136 | end 137 | end 138 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad965e05b08a049f2bd5d60258452b36 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fab9ef1899dc4bf18586c6a01172d62 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbc2200488e7d45189f9a082caf5d637 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/Android/WebViewPlugin-development.aar.tmpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package-nofragment/Assets/Plugins/Android/WebViewPlugin-development.aar.tmpl -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/Android/WebViewPlugin-development.aar.tmpl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cfd7b6baeab943089b567032c2b3ee6 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/Android/WebViewPlugin-release.aar.tmpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package-nofragment/Assets/Plugins/Android/WebViewPlugin-release.aar.tmpl -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/Android/WebViewPlugin-release.aar.tmpl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69e600137811c42778f78793d1022369 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5415c2bc4488c42739b36767bc7f8c83 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/Editor/UnityWebViewPostprocessBuild.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b2f5f306eb6e4afcbc074e6efccc188 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60e7bf38137eb4950b2f02b7d57c1ad3 3 | folderAsset: yes 4 | PluginImporter: 5 | serializedVersion: 1 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | platformData: 10 | Android: 11 | enabled: 0 12 | settings: 13 | CPU: AnyCPU 14 | Any: 15 | enabled: 0 16 | settings: {} 17 | Editor: 18 | enabled: 1 19 | settings: 20 | CPU: AnyCPU 21 | DefaultValueInitialized: true 22 | OS: OSX 23 | Linux: 24 | enabled: 0 25 | settings: 26 | CPU: x86 27 | Linux64: 28 | enabled: 0 29 | settings: 30 | CPU: x86_64 31 | OSXIntel: 32 | enabled: 1 33 | settings: 34 | CPU: AnyCPU 35 | OSXIntel64: 36 | enabled: 1 37 | settings: 38 | CPU: AnyCPU 39 | OSXUniversal: 40 | enabled: 1 41 | settings: 42 | CPU: AnyCPU 43 | Win: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | Win64: 48 | enabled: 0 49 | settings: 50 | CPU: AnyCPU 51 | iOS: 52 | enabled: 0 53 | settings: 54 | CompileFlags: 55 | FrameworkDependencies: 56 | userData: 57 | assetBundleName: 58 | assetBundleVariant: 59 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee2bc92b52f924630bfd4aff89395583 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 24E263 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | WebView 11 | CFBundleIdentifier 12 | net.gree.unitywebview.WebView 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | WebView 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 24E241 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 15.4 37 | DTSDKBuild 38 | 24E241 39 | DTSDKName 40 | macosx15.4 41 | DTXcode 42 | 1630 43 | DTXcodeBuild 44 | 16E140 45 | LSMinimumSystemVersion 46 | 10.13 47 | 48 | 49 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5cac4b018fc441519472619c00b4a19 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7583463a0bdf148919eb1819ff8790ab 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3472ba57f3d2c40728fe4fa686337555 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8d99a8979b8445dc8d524538cf76521 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/Resources/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/Resources/InfoPlist.strings -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/Resources/InfoPlist.strings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d60a4326049747b58f27bc930bcd7f4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/_CodeSignature.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4f429b11407f476894734317eaa0089 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/InfoPlist.strings 8 | 9 | MiLKDDnrUKr4EmuvhS5VQwxHGK8= 10 | 11 | 12 | files2 13 | 14 | Resources/InfoPlist.strings 15 | 16 | hash2 17 | 18 | Oc8u4Ht7Mz58F50L9NeYpbcq9qTlhPUeZCcDu/pPyCg= 19 | 20 | 21 | 22 | rules 23 | 24 | ^Resources/ 25 | 26 | ^Resources/.*\.lproj/ 27 | 28 | optional 29 | 30 | weight 31 | 1000 32 | 33 | ^Resources/.*\.lproj/locversion.plist$ 34 | 35 | omit 36 | 37 | weight 38 | 1100 39 | 40 | ^Resources/Base\.lproj/ 41 | 42 | weight 43 | 1010 44 | 45 | ^version.plist$ 46 | 47 | 48 | rules2 49 | 50 | .*\.dSYM($|/) 51 | 52 | weight 53 | 11 54 | 55 | ^(.*/)?\.DS_Store$ 56 | 57 | omit 58 | 59 | weight 60 | 2000 61 | 62 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 63 | 64 | nested 65 | 66 | weight 67 | 10 68 | 69 | ^.* 70 | 71 | ^Info\.plist$ 72 | 73 | omit 74 | 75 | weight 76 | 20 77 | 78 | ^PkgInfo$ 79 | 80 | omit 81 | 82 | weight 83 | 20 84 | 85 | ^Resources/ 86 | 87 | weight 88 | 20 89 | 90 | ^Resources/.*\.lproj/ 91 | 92 | optional 93 | 94 | weight 95 | 1000 96 | 97 | ^Resources/.*\.lproj/locversion.plist$ 98 | 99 | omit 100 | 101 | weight 102 | 1100 103 | 104 | ^Resources/Base\.lproj/ 105 | 106 | weight 107 | 1010 108 | 109 | ^[^/]+$ 110 | 111 | nested 112 | 113 | weight 114 | 10 115 | 116 | ^embedded\.provisionprofile$ 117 | 118 | weight 119 | 20 120 | 121 | ^version\.plist$ 122 | 123 | weight 124 | 20 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/_CodeSignature/CodeResources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7484b160ebd7c40bd9c42038fa7b69a8 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/WebViewObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4d2b188f50df4b299eb714ef4360ee9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a53a54acdc5d64291aa49766bb494025 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/iOS/WebView.mm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cabb4f60971742a28f3bd04e65de504 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | iPhone: iOS 27 | second: 28 | enabled: 1 29 | settings: 30 | AddToEmbeddedBinaries: false 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/iOS/WebViewWithUIWebView.mm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc99cbfa2b53248b18d60e327b478581 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | iPhone: iOS 27 | second: 28 | enabled: 1 29 | settings: 30 | AddToEmbeddedBinaries: false 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/unity-webview-webgl-plugin.jslib: -------------------------------------------------------------------------------- 1 | mergeInto(LibraryManager.library, { 2 | _gree_unity_webview_init: function(name) { 3 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 4 | unityWebView.init(stringify(name)); 5 | }, 6 | 7 | _gree_unity_webview_setMargins: function (name, left, top, right, bottom) { 8 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 9 | unityWebView.setMargins(stringify(name), left, top, right, bottom); 10 | }, 11 | 12 | _gree_unity_webview_setVisibility: function(name, visible) { 13 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 14 | unityWebView.setVisibility(stringify(name), visible); 15 | }, 16 | 17 | _gree_unity_webview_loadURL: function(name, url) { 18 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 19 | unityWebView.loadURL(stringify(name), stringify(url)); 20 | }, 21 | 22 | _gree_unity_webview_evaluateJS: function(name, js) { 23 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 24 | unityWebView.evaluateJS(stringify(name), stringify(js)); 25 | }, 26 | 27 | _gree_unity_webview_destroy: function(name) { 28 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 29 | unityWebView.destroy(stringify(name)); 30 | }, 31 | }); 32 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/Plugins/unity-webview-webgl-plugin.jslib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1353be0798ab043d992cd72e4d92970b 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | WebGL: WebGL 27 | second: 28 | enabled: 1 29 | settings: {} 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 396d2c966866e4a8ca47369a69d03109 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview-2020.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9e103622e8c14154a1cd918fb92795e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview-2020/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Unity WebGL Player | {{{ PRODUCT_NAME }}} 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 |
21 | 26 |
27 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview-2020/index.html.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7be04fa587d934a5c958c8fc02a10c40 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview-2020/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 9 | .appendTo($('#unity-container')); 10 | } 11 | var $last = $('.webviewContainer:last'); 12 | var clonedTop = parseInt($last.css('top')) - 100; 13 | var $clone = $last.clone().insertAfter($last).css('top', clonedTop + '%'); 14 | var $iframe = 15 | $('') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | unityInstance.SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } 28 | }); 29 | 30 | contents.find('form').submit(function () { 31 | $this = $(this); 32 | var action = $.trim($this.attr('action')); 33 | if (action.substr(0, 6) === 'unity:') { 34 | var message = action.substring(6, action.length); 35 | if ($this.attr('method').toLowerCase() == 'get') { 36 | message += '?' + $this.serialize(); 37 | } 38 | unityInstance.SendMessage(name, "CallFromJS", message); 39 | return false; 40 | } 41 | return true; 42 | }); 43 | 44 | unityInstance.SendMessage(name, "CallOnLoaded", location.href); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | unityInstance.SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var container = $('#unity-container'); 54 | var r = (container.hasClass('unity-desktop')) ? window.devicePixelRatio : 1; 55 | var w0 = container.width() * r; 56 | var h0 = container.height() * r; 57 | var canvas = $('#unity-canvas'); 58 | var w1 = canvas.attr('width'); 59 | var h1 = canvas.attr('height'); 60 | 61 | var lp = left / w0 * 100; 62 | var tp = top / h0 * 100; 63 | var wp = (w1 - left - right) / w0 * 100; 64 | var hp = (h1 - top - bottom) / h0 * 100; 65 | 66 | this.iframe(name) 67 | .css('left', lp + '%') 68 | .css('top', tp + '%') 69 | .css('width', wp + '%') 70 | .css('height', hp + '%'); 71 | }, 72 | 73 | setVisibility: function (name, visible) { 74 | if (visible) 75 | this.iframe(name).show(); 76 | else 77 | this.iframe(name).hide(); 78 | }, 79 | 80 | loadURL: function(name, url) { 81 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 82 | }, 83 | 84 | evaluateJS: function (name, js) { 85 | $iframe = this.iframe(name); 86 | if ($iframe.attr('loaded') === 'true') { 87 | $iframe[0].contentWindow.eval(js); 88 | } else { 89 | $iframe.on('load', function(){ 90 | $(this)[0].contentWindow.eval(js); 91 | }); 92 | } 93 | }, 94 | 95 | destroy: function (name) { 96 | this.iframe(name).parent().parent().remove(); 97 | }, 98 | 99 | iframe: function (name) { 100 | return $('#webview_' + name); 101 | }, 102 | 103 | }; 104 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview-2020/unity-webview.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b98600d622f440fab913c56685e11bf 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74f24ca1a6cc14b5c8da7e2a8e5de817 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unity Web Player 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 |
19 |
20 |
21 | 26 |
27 |
28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview/index.html.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd45543727a7e47d88051ca9ab86a6f5 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 9 | .appendTo($('#gameContainer')); 10 | } 11 | var $last = $('.webviewContainer:last'); 12 | var clonedTop = parseInt($last.css('top')) - 100; 13 | var $clone = $last.clone().insertAfter($last).css('top', clonedTop + '%'); 14 | var $iframe = 15 | $('') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | unityInstance.SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } 28 | }); 29 | 30 | contents.find('form').submit(function () { 31 | $this = $(this); 32 | var action = $.trim($this.attr('action')); 33 | if (action.substr(0, 6) === 'unity:') { 34 | var message = action.substring(6, action.length); 35 | if ($this.attr('method').toLowerCase() == 'get') { 36 | message += '?' + $this.serialize(); 37 | } 38 | unityInstance.SendMessage(name, "CallFromJS", message); 39 | return false; 40 | } 41 | return true; 42 | }); 43 | 44 | unityInstance.SendMessage(name, "CallOnLoaded", location.href); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | unityInstance.SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var container = $('#gameContainer'); 54 | var r = window.devicePixelRatio; 55 | var w0 = container.width() * r; 56 | var h0 = container.height() * r; 57 | 58 | var lp = left / w0 * 100; 59 | var tp = top / h0 * 100; 60 | var wp = (w0 - left - right) / w0 * 100; 61 | var hp = (h0 - top - bottom) / h0 * 100; 62 | 63 | this.iframe(name) 64 | .css('left', lp + '%') 65 | .css('top', tp + '%') 66 | .css('width', wp + '%') 67 | .css('height', hp + '%'); 68 | }, 69 | 70 | setVisibility: function (name, visible) { 71 | if (visible) 72 | this.iframe(name).show(); 73 | else 74 | this.iframe(name).hide(); 75 | }, 76 | 77 | loadURL: function(name, url) { 78 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 79 | }, 80 | 81 | evaluateJS: function (name, js) { 82 | $iframe = this.iframe(name); 83 | if ($iframe.attr('loaded') === 'true') { 84 | $iframe[0].contentWindow.eval(js); 85 | } else { 86 | $iframe.on('load', function(){ 87 | $(this)[0].contentWindow.eval(js); 88 | }); 89 | } 90 | }, 91 | 92 | destroy: function (name) { 93 | this.iframe(name).parent().parent().remove(); 94 | }, 95 | 96 | iframe: function (name) { 97 | return $('#webview_' + name); 98 | }, 99 | 100 | }; 101 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebGLTemplates/unity-webview/unity-webview.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8de1ecd3ea5954800b53548d8c2e2d70 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ec4661d3c10c4d0e8b5e54ce1e46aa5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e76c9a30b7f6447eca50079ce4d595ed 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unity Web Player | %UNITY_WEB_NAME% 6 | %UNITY_UNITYOBJECT_DEPENDENCIES% 7 | 15 | 63 | 64 | 118 | 119 | 120 |

Unity Web Player | %UNITY_WEB_NAME%

%UNITY_BETA_WARNING% 121 |
122 |
123 |
124 | 125 | Unity Web Player. Install now! 126 | 127 |
128 |
129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview/index.html.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6333062aa8e346f2abc78ef7a457580 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview/thumbnail.png -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview/thumbnail.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 018355354713f41b2bed252c88e082c7 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | u.getUnity().SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } else { 28 | w.location.replace(href); 29 | } 30 | }); 31 | 32 | contents.find('form').submit(function () { 33 | $this = $(this); 34 | var action = $.trim($this.attr('action')); 35 | if (action.substr(0, 6) === 'unity:') { 36 | var message = action.substring(6, action.length); 37 | if ($this.attr('method').toLowerCase() == 'get') { 38 | message += '?' + $this.serialize(); 39 | } 40 | u.getUnity().SendMessage(name, "CallFromJS", message); 41 | return false; 42 | } 43 | return true; 44 | }); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | u.getUnity().SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var $player = $('#unityPlayer'); 54 | var width = $player.width(); 55 | var height = $player.height(); 56 | 57 | var lp = left / width * 100; 58 | var tp = top / height * 100; 59 | var wp = (width - left - right) / width * 100; 60 | var hp = (height - top - bottom) / height * 100; 61 | 62 | this.iframe(name) 63 | .css('left', lp + '%') 64 | .css('top', tp + '%') 65 | .css('width', wp + '%') 66 | .css('height', hp + '%'); 67 | }, 68 | 69 | setVisibility: function (name, visible) { 70 | if (visible) 71 | this.iframe(name).show(); 72 | else 73 | this.iframe(name).hide(); 74 | }, 75 | 76 | loadURL: function(name, url) { 77 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 78 | }, 79 | 80 | evaluateJS: function (name, js) { 81 | $iframe = this.iframe(name); 82 | if ($iframe.attr('loaded') === 'true') { 83 | $iframe[0].contentWindow.eval(js); 84 | } else { 85 | $iframe.on('load', function(){ 86 | $(this)[0].contentWindow.eval(js); 87 | }); 88 | } 89 | }, 90 | 91 | destroy: function (name) { 92 | this.iframe(name).parent().parent().remove(); 93 | }, 94 | 95 | iframe: function (name) { 96 | return $('#webview_' + name); 97 | }, 98 | 99 | }; 100 | -------------------------------------------------------------------------------- /dist/package-nofragment/Assets/WebPlayerTemplates/unity-webview/unity-webview.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bf88e2aa1e624d64b530ad0c2383b9e 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "net.gree.unity-webview", 3 | "displayName": "unity-webview", 4 | "version": "1.0.0", 5 | "unity": "2019.1", 6 | "description": "A plugin to display native webview views.", 7 | "dependencies": {} 8 | } 9 | -------------------------------------------------------------------------------- /dist/package-nofragment/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d863dd473116e4930a3d4f7444365973 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package-nofragment/unity-webview.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unity-webview", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [ 6 | "Android", 7 | "Editor", 8 | "iOS", 9 | "macOSStandalone", 10 | "WebGL", 11 | "WindowsStandalone64" 12 | ], 13 | "excludePlatforms": [], 14 | "allowUnsafeCode": false, 15 | "overrideReferences": false, 16 | "precompiledReferences": [], 17 | "autoReferenced": true, 18 | "defineConstraints": [], 19 | "versionDefines": [] 20 | } 21 | -------------------------------------------------------------------------------- /dist/package-nofragment/unity-webview.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df2a24f83ece042be84d3276a68393ed 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad965e05b08a049f2bd5d60258452b36 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3fab9ef1899dc4bf18586c6a01172d62 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbc2200488e7d45189f9a082caf5d637 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Android/WebViewPlugin-development.aar.tmpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package/Assets/Plugins/Android/WebViewPlugin-development.aar.tmpl -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Android/WebViewPlugin-development.aar.tmpl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59b3f9343bdac42318926c7944365bb9 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Android/WebViewPlugin-release.aar.tmpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package/Assets/Plugins/Android/WebViewPlugin-release.aar.tmpl -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Android/WebViewPlugin-release.aar.tmpl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea6387b3379b4458498b339bcd316c7c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Android/core-1.6.0.aar.tmpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package/Assets/Plugins/Android/core-1.6.0.aar.tmpl -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Android/core-1.6.0.aar.tmpl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70fc6af576ac24f6aa283eecbf393621 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5415c2bc4488c42739b36767bc7f8c83 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/Editor/UnityWebViewPostprocessBuild.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b2f5f306eb6e4afcbc074e6efccc188 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60e7bf38137eb4950b2f02b7d57c1ad3 3 | folderAsset: yes 4 | PluginImporter: 5 | serializedVersion: 1 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | platformData: 10 | Android: 11 | enabled: 0 12 | settings: 13 | CPU: AnyCPU 14 | Any: 15 | enabled: 0 16 | settings: {} 17 | Editor: 18 | enabled: 1 19 | settings: 20 | CPU: AnyCPU 21 | DefaultValueInitialized: true 22 | OS: OSX 23 | Linux: 24 | enabled: 0 25 | settings: 26 | CPU: x86 27 | Linux64: 28 | enabled: 0 29 | settings: 30 | CPU: x86_64 31 | OSXIntel: 32 | enabled: 1 33 | settings: 34 | CPU: AnyCPU 35 | OSXIntel64: 36 | enabled: 1 37 | settings: 38 | CPU: AnyCPU 39 | OSXUniversal: 40 | enabled: 1 41 | settings: 42 | CPU: AnyCPU 43 | Win: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | Win64: 48 | enabled: 0 49 | settings: 50 | CPU: AnyCPU 51 | iOS: 52 | enabled: 0 53 | settings: 54 | CompileFlags: 55 | FrameworkDependencies: 56 | userData: 57 | assetBundleName: 58 | assetBundleVariant: 59 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee2bc92b52f924630bfd4aff89395583 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 24E263 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | WebView 11 | CFBundleIdentifier 12 | net.gree.unitywebview.WebView 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | WebView 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 24E241 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 15.4 37 | DTSDKBuild 38 | 24E241 39 | DTSDKName 40 | macosx15.4 41 | DTXcode 42 | 1630 43 | DTXcodeBuild 44 | 16E140 45 | LSMinimumSystemVersion 46 | 10.13 47 | 48 | 49 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5cac4b018fc441519472619c00b4a19 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7583463a0bdf148919eb1819ff8790ab 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3472ba57f3d2c40728fe4fa686337555 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8d99a8979b8445dc8d524538cf76521 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/Resources/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package/Assets/Plugins/WebView.bundle/Contents/Resources/InfoPlist.strings -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/Resources/InfoPlist.strings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d60a4326049747b58f27bc930bcd7f4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/_CodeSignature.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4f429b11407f476894734317eaa0089 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/InfoPlist.strings 8 | 9 | MiLKDDnrUKr4EmuvhS5VQwxHGK8= 10 | 11 | 12 | files2 13 | 14 | Resources/InfoPlist.strings 15 | 16 | hash2 17 | 18 | Oc8u4Ht7Mz58F50L9NeYpbcq9qTlhPUeZCcDu/pPyCg= 19 | 20 | 21 | 22 | rules 23 | 24 | ^Resources/ 25 | 26 | ^Resources/.*\.lproj/ 27 | 28 | optional 29 | 30 | weight 31 | 1000 32 | 33 | ^Resources/.*\.lproj/locversion.plist$ 34 | 35 | omit 36 | 37 | weight 38 | 1100 39 | 40 | ^Resources/Base\.lproj/ 41 | 42 | weight 43 | 1010 44 | 45 | ^version.plist$ 46 | 47 | 48 | rules2 49 | 50 | .*\.dSYM($|/) 51 | 52 | weight 53 | 11 54 | 55 | ^(.*/)?\.DS_Store$ 56 | 57 | omit 58 | 59 | weight 60 | 2000 61 | 62 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 63 | 64 | nested 65 | 66 | weight 67 | 10 68 | 69 | ^.* 70 | 71 | ^Info\.plist$ 72 | 73 | omit 74 | 75 | weight 76 | 20 77 | 78 | ^PkgInfo$ 79 | 80 | omit 81 | 82 | weight 83 | 20 84 | 85 | ^Resources/ 86 | 87 | weight 88 | 20 89 | 90 | ^Resources/.*\.lproj/ 91 | 92 | optional 93 | 94 | weight 95 | 1000 96 | 97 | ^Resources/.*\.lproj/locversion.plist$ 98 | 99 | omit 100 | 101 | weight 102 | 1100 103 | 104 | ^Resources/Base\.lproj/ 105 | 106 | weight 107 | 1010 108 | 109 | ^[^/]+$ 110 | 111 | nested 112 | 113 | weight 114 | 10 115 | 116 | ^embedded\.provisionprofile$ 117 | 118 | weight 119 | 20 120 | 121 | ^version\.plist$ 122 | 123 | weight 124 | 20 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebView.bundle/Contents/_CodeSignature/CodeResources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7484b160ebd7c40bd9c42038fa7b69a8 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/WebViewObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4d2b188f50df4b299eb714ef4360ee9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a53a54acdc5d64291aa49766bb494025 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/iOS/WebView.mm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cabb4f60971742a28f3bd04e65de504 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | iPhone: iOS 27 | second: 28 | enabled: 1 29 | settings: 30 | AddToEmbeddedBinaries: false 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/iOS/WebViewWithUIWebView.mm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc99cbfa2b53248b18d60e327b478581 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | iPhone: iOS 27 | second: 28 | enabled: 1 29 | settings: 30 | AddToEmbeddedBinaries: false 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/unity-webview-webgl-plugin.jslib: -------------------------------------------------------------------------------- 1 | mergeInto(LibraryManager.library, { 2 | _gree_unity_webview_init: function(name) { 3 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 4 | unityWebView.init(stringify(name)); 5 | }, 6 | 7 | _gree_unity_webview_setMargins: function (name, left, top, right, bottom) { 8 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 9 | unityWebView.setMargins(stringify(name), left, top, right, bottom); 10 | }, 11 | 12 | _gree_unity_webview_setVisibility: function(name, visible) { 13 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 14 | unityWebView.setVisibility(stringify(name), visible); 15 | }, 16 | 17 | _gree_unity_webview_loadURL: function(name, url) { 18 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 19 | unityWebView.loadURL(stringify(name), stringify(url)); 20 | }, 21 | 22 | _gree_unity_webview_evaluateJS: function(name, js) { 23 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 24 | unityWebView.evaluateJS(stringify(name), stringify(js)); 25 | }, 26 | 27 | _gree_unity_webview_destroy: function(name) { 28 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 29 | unityWebView.destroy(stringify(name)); 30 | }, 31 | }); 32 | -------------------------------------------------------------------------------- /dist/package/Assets/Plugins/unity-webview-webgl-plugin.jslib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1353be0798ab043d992cd72e4d92970b 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | WebGL: WebGL 27 | second: 28 | enabled: 1 29 | settings: {} 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 396d2c966866e4a8ca47369a69d03109 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview-2020.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9e103622e8c14154a1cd918fb92795e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview-2020/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Unity WebGL Player | {{{ PRODUCT_NAME }}} 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 |
21 | 26 |
27 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview-2020/index.html.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7be04fa587d934a5c958c8fc02a10c40 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview-2020/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 9 | .appendTo($('#unity-container')); 10 | } 11 | var $last = $('.webviewContainer:last'); 12 | var clonedTop = parseInt($last.css('top')) - 100; 13 | var $clone = $last.clone().insertAfter($last).css('top', clonedTop + '%'); 14 | var $iframe = 15 | $('') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | unityInstance.SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } 28 | }); 29 | 30 | contents.find('form').submit(function () { 31 | $this = $(this); 32 | var action = $.trim($this.attr('action')); 33 | if (action.substr(0, 6) === 'unity:') { 34 | var message = action.substring(6, action.length); 35 | if ($this.attr('method').toLowerCase() == 'get') { 36 | message += '?' + $this.serialize(); 37 | } 38 | unityInstance.SendMessage(name, "CallFromJS", message); 39 | return false; 40 | } 41 | return true; 42 | }); 43 | 44 | unityInstance.SendMessage(name, "CallOnLoaded", location.href); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | unityInstance.SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var container = $('#unity-container'); 54 | var r = (container.hasClass('unity-desktop')) ? window.devicePixelRatio : 1; 55 | var w0 = container.width() * r; 56 | var h0 = container.height() * r; 57 | var canvas = $('#unity-canvas'); 58 | var w1 = canvas.attr('width'); 59 | var h1 = canvas.attr('height'); 60 | 61 | var lp = left / w0 * 100; 62 | var tp = top / h0 * 100; 63 | var wp = (w1 - left - right) / w0 * 100; 64 | var hp = (h1 - top - bottom) / h0 * 100; 65 | 66 | this.iframe(name) 67 | .css('left', lp + '%') 68 | .css('top', tp + '%') 69 | .css('width', wp + '%') 70 | .css('height', hp + '%'); 71 | }, 72 | 73 | setVisibility: function (name, visible) { 74 | if (visible) 75 | this.iframe(name).show(); 76 | else 77 | this.iframe(name).hide(); 78 | }, 79 | 80 | loadURL: function(name, url) { 81 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 82 | }, 83 | 84 | evaluateJS: function (name, js) { 85 | $iframe = this.iframe(name); 86 | if ($iframe.attr('loaded') === 'true') { 87 | $iframe[0].contentWindow.eval(js); 88 | } else { 89 | $iframe.on('load', function(){ 90 | $(this)[0].contentWindow.eval(js); 91 | }); 92 | } 93 | }, 94 | 95 | destroy: function (name) { 96 | this.iframe(name).parent().parent().remove(); 97 | }, 98 | 99 | iframe: function (name) { 100 | return $('#webview_' + name); 101 | }, 102 | 103 | }; 104 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview-2020/unity-webview.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b98600d622f440fab913c56685e11bf 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74f24ca1a6cc14b5c8da7e2a8e5de817 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unity Web Player 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 |
19 |
20 |
21 | 26 |
27 |
28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview/index.html.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd45543727a7e47d88051ca9ab86a6f5 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 9 | .appendTo($('#gameContainer')); 10 | } 11 | var $last = $('.webviewContainer:last'); 12 | var clonedTop = parseInt($last.css('top')) - 100; 13 | var $clone = $last.clone().insertAfter($last).css('top', clonedTop + '%'); 14 | var $iframe = 15 | $('') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | unityInstance.SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } 28 | }); 29 | 30 | contents.find('form').submit(function () { 31 | $this = $(this); 32 | var action = $.trim($this.attr('action')); 33 | if (action.substr(0, 6) === 'unity:') { 34 | var message = action.substring(6, action.length); 35 | if ($this.attr('method').toLowerCase() == 'get') { 36 | message += '?' + $this.serialize(); 37 | } 38 | unityInstance.SendMessage(name, "CallFromJS", message); 39 | return false; 40 | } 41 | return true; 42 | }); 43 | 44 | unityInstance.SendMessage(name, "CallOnLoaded", location.href); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | unityInstance.SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var container = $('#gameContainer'); 54 | var r = window.devicePixelRatio; 55 | var w0 = container.width() * r; 56 | var h0 = container.height() * r; 57 | 58 | var lp = left / w0 * 100; 59 | var tp = top / h0 * 100; 60 | var wp = (w0 - left - right) / w0 * 100; 61 | var hp = (h0 - top - bottom) / h0 * 100; 62 | 63 | this.iframe(name) 64 | .css('left', lp + '%') 65 | .css('top', tp + '%') 66 | .css('width', wp + '%') 67 | .css('height', hp + '%'); 68 | }, 69 | 70 | setVisibility: function (name, visible) { 71 | if (visible) 72 | this.iframe(name).show(); 73 | else 74 | this.iframe(name).hide(); 75 | }, 76 | 77 | loadURL: function(name, url) { 78 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 79 | }, 80 | 81 | evaluateJS: function (name, js) { 82 | $iframe = this.iframe(name); 83 | if ($iframe.attr('loaded') === 'true') { 84 | $iframe[0].contentWindow.eval(js); 85 | } else { 86 | $iframe.on('load', function(){ 87 | $(this)[0].contentWindow.eval(js); 88 | }); 89 | } 90 | }, 91 | 92 | destroy: function (name) { 93 | this.iframe(name).parent().parent().remove(); 94 | }, 95 | 96 | iframe: function (name) { 97 | return $('#webview_' + name); 98 | }, 99 | 100 | }; 101 | -------------------------------------------------------------------------------- /dist/package/Assets/WebGLTemplates/unity-webview/unity-webview.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8de1ecd3ea5954800b53548d8c2e2d70 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ec4661d3c10c4d0e8b5e54ce1e46aa5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates/unity-webview.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e76c9a30b7f6447eca50079ce4d595ed 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates/unity-webview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unity Web Player | %UNITY_WEB_NAME% 6 | %UNITY_UNITYOBJECT_DEPENDENCIES% 7 | 15 | 63 | 64 | 118 | 119 | 120 |

Unity Web Player | %UNITY_WEB_NAME%

%UNITY_BETA_WARNING% 121 |
122 |
123 |
124 | 125 | Unity Web Player. Install now! 126 | 127 |
128 |
129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates/unity-webview/index.html.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6333062aa8e346f2abc78ef7a457580 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates/unity-webview/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/package/Assets/WebPlayerTemplates/unity-webview/thumbnail.png -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates/unity-webview/thumbnail.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 018355354713f41b2bed252c88e082c7 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates/unity-webview/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | u.getUnity().SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } else { 28 | w.location.replace(href); 29 | } 30 | }); 31 | 32 | contents.find('form').submit(function () { 33 | $this = $(this); 34 | var action = $.trim($this.attr('action')); 35 | if (action.substr(0, 6) === 'unity:') { 36 | var message = action.substring(6, action.length); 37 | if ($this.attr('method').toLowerCase() == 'get') { 38 | message += '?' + $this.serialize(); 39 | } 40 | u.getUnity().SendMessage(name, "CallFromJS", message); 41 | return false; 42 | } 43 | return true; 44 | }); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | u.getUnity().SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var $player = $('#unityPlayer'); 54 | var width = $player.width(); 55 | var height = $player.height(); 56 | 57 | var lp = left / width * 100; 58 | var tp = top / height * 100; 59 | var wp = (width - left - right) / width * 100; 60 | var hp = (height - top - bottom) / height * 100; 61 | 62 | this.iframe(name) 63 | .css('left', lp + '%') 64 | .css('top', tp + '%') 65 | .css('width', wp + '%') 66 | .css('height', hp + '%'); 67 | }, 68 | 69 | setVisibility: function (name, visible) { 70 | if (visible) 71 | this.iframe(name).show(); 72 | else 73 | this.iframe(name).hide(); 74 | }, 75 | 76 | loadURL: function(name, url) { 77 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 78 | }, 79 | 80 | evaluateJS: function (name, js) { 81 | $iframe = this.iframe(name); 82 | if ($iframe.attr('loaded') === 'true') { 83 | $iframe[0].contentWindow.eval(js); 84 | } else { 85 | $iframe.on('load', function(){ 86 | $(this)[0].contentWindow.eval(js); 87 | }); 88 | } 89 | }, 90 | 91 | destroy: function (name) { 92 | this.iframe(name).parent().parent().remove(); 93 | }, 94 | 95 | iframe: function (name) { 96 | return $('#webview_' + name); 97 | }, 98 | 99 | }; 100 | -------------------------------------------------------------------------------- /dist/package/Assets/WebPlayerTemplates/unity-webview/unity-webview.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bf88e2aa1e624d64b530ad0c2383b9e 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "net.gree.unity-webview", 3 | "displayName": "unity-webview", 4 | "version": "1.0.0", 5 | "unity": "2019.1", 6 | "description": "A plugin to display native webview views.", 7 | "dependencies": {} 8 | } 9 | -------------------------------------------------------------------------------- /dist/package/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d863dd473116e4930a3d4f7444365973 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/package/unity-webview.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unity-webview", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [ 6 | "Android", 7 | "Editor", 8 | "iOS", 9 | "macOSStandalone", 10 | "WebGL", 11 | "WindowsStandalone64" 12 | ], 13 | "excludePlatforms": [], 14 | "allowUnsafeCode": false, 15 | "overrideReferences": false, 16 | "precompiledReferences": [], 17 | "autoReferenced": true, 18 | "defineConstraints": [], 19 | "versionDefines": [] 20 | } 21 | -------------------------------------------------------------------------------- /dist/package/unity-webview.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df2a24f83ece042be84d3276a68393ed 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /dist/unity-webview-nofragment.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/unity-webview-nofragment.unitypackage -------------------------------------------------------------------------------- /dist/unity-webview-nofragment.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/unity-webview-nofragment.zip -------------------------------------------------------------------------------- /dist/unity-webview.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/unity-webview.unitypackage -------------------------------------------------------------------------------- /dist/unity-webview.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/dist/unity-webview.zip -------------------------------------------------------------------------------- /plugins/Android/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | gen 3 | local.properties 4 | obj 5 | proguard.cfg 6 | -------------------------------------------------------------------------------- /plugins/Android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | jcenter().mavenContent { 6 | includeGroup("org.jetbrains.trove4j") 7 | } 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:4.1.0' 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | jcenter().mavenContent { 19 | includeGroup("org.jetbrains.trove4j") 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /plugins/Android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | -------------------------------------------------------------------------------- /plugins/Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/plugins/Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /plugins/Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Feb 13 14:32:18 JST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip 7 | -------------------------------------------------------------------------------- /plugins/Android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /plugins/Android/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # directories 5 | CWD=`dirname $0` 6 | CWD=`cd $CWD && pwd -P` 7 | 8 | case $(uname) in 9 | Darwin) 10 | export JAVA_HOME='/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/AndroidPlayer/OpenJDK' 11 | export ANDROID_SDK_ROOT='/Applications/Unity/Hub/Editor/2019.4.40f1/PlaybackEngines/AndroidPlayer/SDK' 12 | export PATH=$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/tools/bin:$JAVA_HOME/bin:$PATH 13 | ;; 14 | MINGW64_NT*) 15 | export JAVA_HOME='/c/PROGRA~1/Unity/Hub/Editor/2019.4.40f1/Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK' 16 | export ANDROID_SDK_ROOT='/c/PROGRA~1/Unity/Hub/Editor/2019.4.40f1/Editor/Data/PlaybackEngines/AndroidPlayer/SDK' 17 | export PATH=$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/tools/bin:$JAVA_HOME/bin:$PATH 18 | ;; 19 | esac 20 | DEST_DIR='../../build/Packager/Assets/Plugins/Android' 21 | 22 | if [ ! -d "$JAVA_HOME" ] 23 | then 24 | echo 'From Unity Hub, please install 2019.4.40f1 with the android module.' 25 | exit 1 26 | fi 27 | 28 | # options 29 | TARGET="webview" 30 | MODE="Release" 31 | UNITY='2019.4.40f1' 32 | for OPT in $* 33 | do 34 | case $OPT in 35 | '--nofragment') 36 | TARGET="webview-nofragment" 37 | ;; 38 | '--development') 39 | MODE="Development" 40 | ;; 41 | '--zorderpatch') 42 | UNITY='5.6.1f1' 43 | ;; 44 | *) 45 | cat < ${TARGET}/src/main/java/net/gree/unitywebview/CWebViewPlugin.java 89 | ;; 90 | *) 91 | dst=${DEST_DIR}/WebViewPlugin-development.aar.tmpl 92 | cp -a $tmp/CWebViewPlugin.java ${TARGET}/src/main/java/net/gree/unitywebview/CWebViewPlugin.java 93 | ;; 94 | esac 95 | # remove CUnityPlayer*.java if UNITY != 5.6.1f1. 96 | case $UNITY in 97 | '5.6.1f1') 98 | ;; 99 | *) 100 | rm -f ${TARGET}/src/main/java/net/gree/unitywebview/CUnityPlayer*.java 101 | ;; 102 | esac 103 | 104 | pushd $CWD 105 | 106 | # build 107 | cp "${UNITY_DIR}/PlaybackEngines/AndroidPlayer/Variations/il2cpp/${MODE}/Classes/classes.jar" ${TARGET}/libs 108 | ./gradlew clean -p $TARGET 109 | ./gradlew assembleRelease -p $TARGET 110 | 111 | # install 112 | mkdir -p ${DEST_DIR} 113 | echo cp ${TARGET}/build/outputs/aar/*.aar $dst 114 | cp ${TARGET}/build/outputs/aar/*.aar $dst 115 | case $TARGET in 116 | 'webview') 117 | core_aar=`basename ${TARGET}/libs-ext/core*.aar` 118 | echo cp ${TARGET}/libs-ext/$core_aar ${DEST_DIR}/$core_aar.tmpl 119 | cp ${TARGET}/libs-ext/$core_aar ${DEST_DIR}/$core_aar.tmpl 120 | ;; 121 | esac 122 | 123 | popd 124 | -------------------------------------------------------------------------------- /plugins/Android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':webview' 2 | include ':webview-nofragment' 3 | -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 30 5 | buildToolsVersion "30.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 30 10 | versionCode 1 11 | versionName "1.0" 12 | consumerProguardFiles "consumer-rules.pro" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compileOnly fileTree(dir: 'libs', include: ['*.jar']) 24 | } 25 | -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class net.gree.unitywebview.** { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/plugins/Android/webview-nofragment/libs/.gitkeep -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/src/main/java/net/gree/unitywebview/CUnityPlayer.java: -------------------------------------------------------------------------------- 1 | package net.gree.unitywebview; 2 | 3 | import com.unity3d.player.*; 4 | import android.content.ContextWrapper; 5 | import android.view.SurfaceView; 6 | import android.view.View; 7 | 8 | public class CUnityPlayer 9 | extends UnityPlayer 10 | { 11 | public CUnityPlayer(ContextWrapper contextwrapper) { 12 | super(contextwrapper); 13 | } 14 | 15 | public void addView(View child) { 16 | if (child instanceof SurfaceView) { 17 | ((SurfaceView)child).setZOrderOnTop(false); 18 | } 19 | super.addView(child); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/src/main/java/net/gree/unitywebview/CUnityPlayerActivity.java: -------------------------------------------------------------------------------- 1 | package net.gree.unitywebview; 2 | 3 | import com.unity3d.player.*; 4 | import android.os.Bundle; 5 | 6 | public class CUnityPlayerActivity 7 | extends UnityPlayerActivity 8 | { 9 | @Override 10 | public void onCreate(Bundle bundle) { 11 | requestWindowFeature(1); 12 | super.onCreate(bundle); 13 | getWindow().setFormat(2); 14 | mUnityPlayer = new CUnityPlayer(this); 15 | setContentView(mUnityPlayer); 16 | mUnityPlayer.requestFocus(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /plugins/Android/webview-nofragment/src/main/java/net/gree/unitywebview/RoundedWebView.java: -------------------------------------------------------------------------------- 1 | package net.gree.unitywebview; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.Path; 8 | import android.graphics.PorterDuff; 9 | import android.graphics.PorterDuffXfermode; 10 | import android.graphics.RectF; 11 | import android.util.AttributeSet; 12 | import android.util.TypedValue; 13 | import android.webkit.WebView; 14 | 15 | public class RoundedWebView extends WebView{ 16 | private Context context; 17 | private int width; 18 | private int height; 19 | private int radius; 20 | private int dpRadius; 21 | 22 | public RoundedWebView(Context context, int radius) 23 | { 24 | super(context); 25 | this.dpRadius = radius; 26 | initialize(context); 27 | } 28 | 29 | public RoundedWebView(Context context, AttributeSet attrs, int radius) 30 | { 31 | super(context, attrs); 32 | this.dpRadius = radius; 33 | initialize(context); 34 | } 35 | 36 | public RoundedWebView(Context context, AttributeSet attrs, int defStyleAttr, int radius) 37 | { 38 | super(context, attrs, defStyleAttr); 39 | this.dpRadius = radius; 40 | initialize(context); 41 | } 42 | 43 | private void initialize(Context context) 44 | { 45 | this.context = context; 46 | } 47 | 48 | private float dpToPx(Context context, int dp) 49 | { 50 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics()); 51 | } 52 | 53 | @Override protected void onSizeChanged(int newWidth, int newHeight, int oldWidth, int oldHeight) 54 | { 55 | super.onSizeChanged(newWidth, newHeight, oldWidth, oldHeight); 56 | 57 | width = newWidth; 58 | 59 | height = newHeight; 60 | 61 | radius = (int)dpToPx(context, this.dpRadius); 62 | } 63 | 64 | @Override protected void onDraw(Canvas canvas) 65 | { 66 | super.onDraw(canvas); 67 | 68 | Path path = new Path(); 69 | 70 | path.setFillType(Path.FillType.INVERSE_WINDING); 71 | 72 | path.addRoundRect(new RectF(0, getScrollY(), width, getScrollY() + height), radius, radius, Path.Direction.CW); 73 | 74 | canvas.drawPath(path, createPorterDuffClearPaint()); 75 | } 76 | 77 | private Paint createPorterDuffClearPaint() 78 | { 79 | Paint paint = new Paint(); 80 | 81 | paint.setColor(Color.TRANSPARENT); 82 | 83 | paint.setStyle(Paint.Style.FILL); 84 | 85 | paint.setAntiAlias(true); 86 | 87 | paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); 88 | 89 | return paint; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /plugins/Android/webview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 30 5 | buildToolsVersion "30.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 30 10 | versionCode 1 11 | versionName "1.0" 12 | consumerProguardFiles "consumer-rules.pro" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compileOnly fileTree(dir: 'libs', include: ['*.jar']) 24 | implementation 'androidx.core:core:1.6.0' 25 | } 26 | -------------------------------------------------------------------------------- /plugins/Android/webview/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class net.gree.unitywebview.** { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /plugins/Android/webview/libs-ext/core-1.6.0.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/plugins/Android/webview/libs-ext/core-1.6.0.aar -------------------------------------------------------------------------------- /plugins/Android/webview/libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/plugins/Android/webview/libs/.gitkeep -------------------------------------------------------------------------------- /plugins/Android/webview/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /plugins/Android/webview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /plugins/Android/webview/src/main/java/net/gree/unitywebview/CUnityPlayer.java: -------------------------------------------------------------------------------- 1 | package net.gree.unitywebview; 2 | 3 | import com.unity3d.player.*; 4 | import android.content.ContextWrapper; 5 | import android.view.SurfaceView; 6 | import android.view.View; 7 | 8 | public class CUnityPlayer 9 | extends UnityPlayer 10 | { 11 | public CUnityPlayer(ContextWrapper contextwrapper) { 12 | super(contextwrapper); 13 | } 14 | 15 | public void addView(View child) { 16 | if (child instanceof SurfaceView) { 17 | ((SurfaceView)child).setZOrderOnTop(false); 18 | } 19 | super.addView(child); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /plugins/Android/webview/src/main/java/net/gree/unitywebview/CUnityPlayerActivity.java: -------------------------------------------------------------------------------- 1 | package net.gree.unitywebview; 2 | 3 | import com.unity3d.player.*; 4 | import android.os.Bundle; 5 | 6 | public class CUnityPlayerActivity 7 | extends UnityPlayerActivity 8 | { 9 | @Override 10 | public void onCreate(Bundle bundle) { 11 | requestWindowFeature(1); 12 | super.onCreate(bundle); 13 | getWindow().setFormat(2); 14 | mUnityPlayer = new CUnityPlayer(this); 15 | setContentView(mUnityPlayer); 16 | mUnityPlayer.requestFocus(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /plugins/Android/webview/src/main/java/net/gree/unitywebview/RoundedWebView.java: -------------------------------------------------------------------------------- 1 | package net.gree.unitywebview; 2 | 3 | import android.content.Context; 4 | import android.graphics.Canvas; 5 | import android.graphics.Color; 6 | import android.graphics.Paint; 7 | import android.graphics.Path; 8 | import android.graphics.PorterDuff; 9 | import android.graphics.PorterDuffXfermode; 10 | import android.graphics.RectF; 11 | import android.util.AttributeSet; 12 | import android.util.TypedValue; 13 | import android.webkit.WebView; 14 | 15 | public class RoundedWebView extends WebView{ 16 | private Context context; 17 | private int width; 18 | private int height; 19 | private int radius; 20 | private int dpRadius; 21 | 22 | public RoundedWebView(Context context, int radius) 23 | { 24 | super(context); 25 | this.dpRadius = radius; 26 | initialize(context); 27 | } 28 | 29 | public RoundedWebView(Context context, AttributeSet attrs, int radius) 30 | { 31 | super(context, attrs); 32 | this.dpRadius = radius; 33 | initialize(context); 34 | } 35 | 36 | public RoundedWebView(Context context, AttributeSet attrs, int defStyleAttr, int radius) 37 | { 38 | super(context, attrs, defStyleAttr); 39 | this.dpRadius = radius; 40 | initialize(context); 41 | } 42 | 43 | private void initialize(Context context) 44 | { 45 | this.context = context; 46 | } 47 | 48 | private float dpToPx(Context context, int dp) 49 | { 50 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics()); 51 | } 52 | 53 | @Override protected void onSizeChanged(int newWidth, int newHeight, int oldWidth, int oldHeight) 54 | { 55 | super.onSizeChanged(newWidth, newHeight, oldWidth, oldHeight); 56 | 57 | width = newWidth; 58 | 59 | height = newHeight; 60 | 61 | radius = (int)dpToPx(context, this.dpRadius); 62 | } 63 | 64 | @Override protected void onDraw(Canvas canvas) 65 | { 66 | super.onDraw(canvas); 67 | 68 | Path path = new Path(); 69 | 70 | path.setFillType(Path.FillType.INVERSE_WINDING); 71 | 72 | path.addRoundRect(new RectF(0, getScrollY(), width, getScrollY() + height), radius, radius, Path.Direction.CW); 73 | 74 | canvas.drawPath(path, createPorterDuffClearPaint()); 75 | } 76 | 77 | private Paint createPorterDuffClearPaint() 78 | { 79 | Paint paint = new Paint(); 80 | 81 | paint.setColor(Color.TRANSPARENT); 82 | 83 | paint.setStyle(Paint.Style.FILL); 84 | 85 | paint.setAntiAlias(true); 86 | 87 | paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)); 88 | 89 | return paint; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /plugins/Mac/.gitignore: -------------------------------------------------------------------------------- 1 | DerivedData 2 | WebView.xcodeproj/project.xcworkspace/xcuserdata/ 3 | WebView.xcodeproj/xcuserdata/ 4 | -------------------------------------------------------------------------------- /plugins/Mac/Resources/Info-WebViewSeparated.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /plugins/Mac/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /plugins/Mac/Resources/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /plugins/Mac/Resources/Prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | -------------------------------------------------------------------------------- /plugins/Mac/WebView.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60e7bf38137eb4950b2f02b7d57c1ad3 3 | folderAsset: yes 4 | PluginImporter: 5 | serializedVersion: 1 6 | iconMap: {} 7 | executionOrder: {} 8 | isPreloaded: 0 9 | platformData: 10 | Android: 11 | enabled: 0 12 | settings: 13 | CPU: AnyCPU 14 | Any: 15 | enabled: 0 16 | settings: {} 17 | Editor: 18 | enabled: 1 19 | settings: 20 | CPU: AnyCPU 21 | DefaultValueInitialized: true 22 | OS: OSX 23 | Linux: 24 | enabled: 0 25 | settings: 26 | CPU: x86 27 | Linux64: 28 | enabled: 0 29 | settings: 30 | CPU: x86_64 31 | OSXIntel: 32 | enabled: 1 33 | settings: 34 | CPU: AnyCPU 35 | OSXIntel64: 36 | enabled: 1 37 | settings: 38 | CPU: AnyCPU 39 | OSXUniversal: 40 | enabled: 1 41 | settings: 42 | CPU: AnyCPU 43 | Win: 44 | enabled: 0 45 | settings: 46 | CPU: AnyCPU 47 | Win64: 48 | enabled: 0 49 | settings: 50 | CPU: AnyCPU 51 | iOS: 52 | enabled: 0 53 | settings: 54 | CompileFlags: 55 | FrameworkDependencies: 56 | userData: 57 | assetBundleName: 58 | assetBundleVariant: 59 | -------------------------------------------------------------------------------- /plugins/Mac/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DSTDIR="../../build/Packager/Assets/Plugins" 3 | rm -rf DerivedData 4 | xcodebuild -target WebView -configuration Release -arch x86_64 -arch arm64 build CONFIGURATION_BUILD_DIR='DerivedData' | xcbeautify 5 | mkdir -p $DSTDIR 6 | 7 | cp -r DerivedData/WebView.bundle $DSTDIR 8 | rm -rf DerivedData 9 | cp *.bundle.meta $DSTDIR 10 | -------------------------------------------------------------------------------- /plugins/WebGLTemplates/unity-webview-2020/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Unity WebGL Player | {{{ PRODUCT_NAME }}} 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 |
21 | 26 |
27 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /plugins/WebGLTemplates/unity-webview-2020/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 9 | .appendTo($('#unity-container')); 10 | } 11 | var $last = $('.webviewContainer:last'); 12 | var clonedTop = parseInt($last.css('top')) - 100; 13 | var $clone = $last.clone().insertAfter($last).css('top', clonedTop + '%'); 14 | var $iframe = 15 | $('') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | unityInstance.SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } 28 | }); 29 | 30 | contents.find('form').submit(function () { 31 | $this = $(this); 32 | var action = $.trim($this.attr('action')); 33 | if (action.substr(0, 6) === 'unity:') { 34 | var message = action.substring(6, action.length); 35 | if ($this.attr('method').toLowerCase() == 'get') { 36 | message += '?' + $this.serialize(); 37 | } 38 | unityInstance.SendMessage(name, "CallFromJS", message); 39 | return false; 40 | } 41 | return true; 42 | }); 43 | 44 | unityInstance.SendMessage(name, "CallOnLoaded", location.href); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | unityInstance.SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var container = $('#unity-container'); 54 | var r = (container.hasClass('unity-desktop')) ? window.devicePixelRatio : 1; 55 | var w0 = container.width() * r; 56 | var h0 = container.height() * r; 57 | var canvas = $('#unity-canvas'); 58 | var w1 = canvas.attr('width'); 59 | var h1 = canvas.attr('height'); 60 | 61 | var lp = left / w0 * 100; 62 | var tp = top / h0 * 100; 63 | var wp = (w1 - left - right) / w0 * 100; 64 | var hp = (h1 - top - bottom) / h0 * 100; 65 | 66 | this.iframe(name) 67 | .css('left', lp + '%') 68 | .css('top', tp + '%') 69 | .css('width', wp + '%') 70 | .css('height', hp + '%'); 71 | }, 72 | 73 | setVisibility: function (name, visible) { 74 | if (visible) 75 | this.iframe(name).show(); 76 | else 77 | this.iframe(name).hide(); 78 | }, 79 | 80 | loadURL: function(name, url) { 81 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 82 | }, 83 | 84 | evaluateJS: function (name, js) { 85 | $iframe = this.iframe(name); 86 | if ($iframe.attr('loaded') === 'true') { 87 | $iframe[0].contentWindow.eval(js); 88 | } else { 89 | $iframe.on('load', function(){ 90 | $(this)[0].contentWindow.eval(js); 91 | }); 92 | } 93 | }, 94 | 95 | destroy: function (name) { 96 | this.iframe(name).parent().parent().remove(); 97 | }, 98 | 99 | iframe: function (name) { 100 | return $('#webview_' + name); 101 | }, 102 | 103 | }; 104 | -------------------------------------------------------------------------------- /plugins/WebGLTemplates/unity-webview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unity Web Player 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 |
19 |
20 |
21 | 26 |
27 |
28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /plugins/WebGLTemplates/unity-webview/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 9 | .appendTo($('#gameContainer')); 10 | } 11 | var $last = $('.webviewContainer:last'); 12 | var clonedTop = parseInt($last.css('top')) - 100; 13 | var $clone = $last.clone().insertAfter($last).css('top', clonedTop + '%'); 14 | var $iframe = 15 | $('') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | unityInstance.SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } 28 | }); 29 | 30 | contents.find('form').submit(function () { 31 | $this = $(this); 32 | var action = $.trim($this.attr('action')); 33 | if (action.substr(0, 6) === 'unity:') { 34 | var message = action.substring(6, action.length); 35 | if ($this.attr('method').toLowerCase() == 'get') { 36 | message += '?' + $this.serialize(); 37 | } 38 | unityInstance.SendMessage(name, "CallFromJS", message); 39 | return false; 40 | } 41 | return true; 42 | }); 43 | 44 | unityInstance.SendMessage(name, "CallOnLoaded", location.href); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | unityInstance.SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var container = $('#gameContainer'); 54 | var r = window.devicePixelRatio; 55 | var w0 = container.width() * r; 56 | var h0 = container.height() * r; 57 | 58 | var lp = left / w0 * 100; 59 | var tp = top / h0 * 100; 60 | var wp = (w0 - left - right) / w0 * 100; 61 | var hp = (h0 - top - bottom) / h0 * 100; 62 | 63 | this.iframe(name) 64 | .css('left', lp + '%') 65 | .css('top', tp + '%') 66 | .css('width', wp + '%') 67 | .css('height', hp + '%'); 68 | }, 69 | 70 | setVisibility: function (name, visible) { 71 | if (visible) 72 | this.iframe(name).show(); 73 | else 74 | this.iframe(name).hide(); 75 | }, 76 | 77 | loadURL: function(name, url) { 78 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 79 | }, 80 | 81 | evaluateJS: function (name, js) { 82 | $iframe = this.iframe(name); 83 | if ($iframe.attr('loaded') === 'true') { 84 | $iframe[0].contentWindow.eval(js); 85 | } else { 86 | $iframe.on('load', function(){ 87 | $(this)[0].contentWindow.eval(js); 88 | }); 89 | } 90 | }, 91 | 92 | destroy: function (name) { 93 | this.iframe(name).parent().parent().remove(); 94 | }, 95 | 96 | iframe: function (name) { 97 | return $('#webview_' + name); 98 | }, 99 | 100 | }; 101 | -------------------------------------------------------------------------------- /plugins/WebPlayerTemplates/unity-webview/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unity Web Player | %UNITY_WEB_NAME% 6 | %UNITY_UNITYOBJECT_DEPENDENCIES% 7 | 15 | 63 | 64 | 118 | 119 | 120 |

Unity Web Player | %UNITY_WEB_NAME%

%UNITY_BETA_WARNING% 121 |
122 |
123 |
124 | 125 | Unity Web Player. Install now! 126 | 127 |
128 |
129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /plugins/WebPlayerTemplates/unity-webview/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/plugins/WebPlayerTemplates/unity-webview/thumbnail.png -------------------------------------------------------------------------------- /plugins/WebPlayerTemplates/unity-webview/unity-webview.js: -------------------------------------------------------------------------------- 1 | var unityWebView = 2 | { 3 | loaded: [], 4 | 5 | init : function (name) { 6 | $containers = $('.webviewContainer'); 7 | if ($containers.length === 0) { 8 | $('
') 16 | .attr('id', 'webview_' + name) 17 | .appendTo($last) 18 | .on('load', function () { 19 | $(this).attr('loaded', 'true'); 20 | var contents = $(this).contents(); 21 | var w = $(this)[0].contentWindow; 22 | contents.find('a').click(function (e) { 23 | var href = $.trim($(this).attr('href')); 24 | if (href.substr(0, 6) === 'unity:') { 25 | u.getUnity().SendMessage(name, "CallFromJS", href.substring(6, href.length)); 26 | e.preventDefault(); 27 | } else { 28 | w.location.replace(href); 29 | } 30 | }); 31 | 32 | contents.find('form').submit(function () { 33 | $this = $(this); 34 | var action = $.trim($this.attr('action')); 35 | if (action.substr(0, 6) === 'unity:') { 36 | var message = action.substring(6, action.length); 37 | if ($this.attr('method').toLowerCase() == 'get') { 38 | message += '?' + $this.serialize(); 39 | } 40 | u.getUnity().SendMessage(name, "CallFromJS", message); 41 | return false; 42 | } 43 | return true; 44 | }); 45 | }); 46 | }, 47 | 48 | sendMessage: function (name, message) { 49 | u.getUnity().SendMessage(name, "CallFromJS", message); 50 | }, 51 | 52 | setMargins: function (name, left, top, right, bottom) { 53 | var $player = $('#unityPlayer'); 54 | var width = $player.width(); 55 | var height = $player.height(); 56 | 57 | var lp = left / width * 100; 58 | var tp = top / height * 100; 59 | var wp = (width - left - right) / width * 100; 60 | var hp = (height - top - bottom) / height * 100; 61 | 62 | this.iframe(name) 63 | .css('left', lp + '%') 64 | .css('top', tp + '%') 65 | .css('width', wp + '%') 66 | .css('height', hp + '%'); 67 | }, 68 | 69 | setVisibility: function (name, visible) { 70 | if (visible) 71 | this.iframe(name).show(); 72 | else 73 | this.iframe(name).hide(); 74 | }, 75 | 76 | loadURL: function(name, url) { 77 | this.iframe(name).attr('loaded', 'false')[0].contentWindow.location.replace(url); 78 | }, 79 | 80 | evaluateJS: function (name, js) { 81 | $iframe = this.iframe(name); 82 | if ($iframe.attr('loaded') === 'true') { 83 | $iframe[0].contentWindow.eval(js); 84 | } else { 85 | $iframe.on('load', function(){ 86 | $(this)[0].contentWindow.eval(js); 87 | }); 88 | } 89 | }, 90 | 91 | destroy: function (name) { 92 | this.iframe(name).parent().parent().remove(); 93 | }, 94 | 95 | iframe: function (name) { 96 | return $('#webview_' + name); 97 | }, 98 | 99 | }; 100 | -------------------------------------------------------------------------------- /plugins/unity-webview-webgl-plugin.jslib: -------------------------------------------------------------------------------- 1 | mergeInto(LibraryManager.library, { 2 | _gree_unity_webview_init: function(name) { 3 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 4 | unityWebView.init(stringify(name)); 5 | }, 6 | 7 | _gree_unity_webview_setMargins: function (name, left, top, right, bottom) { 8 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 9 | unityWebView.setMargins(stringify(name), left, top, right, bottom); 10 | }, 11 | 12 | _gree_unity_webview_setVisibility: function(name, visible) { 13 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 14 | unityWebView.setVisibility(stringify(name), visible); 15 | }, 16 | 17 | _gree_unity_webview_loadURL: function(name, url) { 18 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 19 | unityWebView.loadURL(stringify(name), stringify(url)); 20 | }, 21 | 22 | _gree_unity_webview_evaluateJS: function(name, js) { 23 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 24 | unityWebView.evaluateJS(stringify(name), stringify(js)); 25 | }, 26 | 27 | _gree_unity_webview_destroy: function(name) { 28 | var stringify = (UTF8ToString === undefined) ? Pointer_stringify : UTF8ToString; 29 | unityWebView.destroy(stringify(name)); 30 | }, 31 | }); 32 | -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | *.app 63 | 64 | # Crashlytics generated file 65 | crashlytics-build.properties 66 | 67 | # Packed Addressables 68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 69 | 70 | # Temporary auto-generated Android Assets 71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 72 | /[Aa]ssets/[Ss]treamingAssets/aa/* 73 | -------------------------------------------------------------------------------- /sample/Assets/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f15752161c914268961641453e4c9cf 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /sample/Assets/Animations/Pop.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Pop 9 | serializedVersion: 6 10 | m_Legacy: 1 11 | m_Compressed: 0 12 | m_UseHighQualityCurve: 1 13 | m_RotationCurves: [] 14 | m_CompressedRotationCurves: [] 15 | m_EulerCurves: [] 16 | m_PositionCurves: [] 17 | m_ScaleCurves: [] 18 | m_FloatCurves: 19 | - curve: 20 | serializedVersion: 2 21 | m_Curve: 22 | - serializedVersion: 2 23 | time: 0 24 | value: 0 25 | inSlope: 0 26 | outSlope: 0 27 | tangentMode: 136 28 | - serializedVersion: 2 29 | time: 1 30 | value: 0 31 | inSlope: 0 32 | outSlope: 0 33 | tangentMode: 136 34 | m_PreInfinity: 2 35 | m_PostInfinity: 2 36 | m_RotationOrder: 4 37 | attribute: m_Pivot.x 38 | path: 39 | classID: 224 40 | script: {fileID: 0} 41 | - curve: 42 | serializedVersion: 2 43 | m_Curve: 44 | - serializedVersion: 2 45 | time: 0 46 | value: 1 47 | inSlope: 0 48 | outSlope: 0 49 | tangentMode: 136 50 | - serializedVersion: 2 51 | time: 0.16666667 52 | value: 0 53 | inSlope: -3 54 | outSlope: -3 55 | tangentMode: 34 56 | - serializedVersion: 2 57 | time: 0.8333333 58 | value: 0 59 | inSlope: 2.9999998 60 | outSlope: 2.9999998 61 | tangentMode: 34 62 | - serializedVersion: 2 63 | time: 1 64 | value: 1 65 | inSlope: 0 66 | outSlope: 0 67 | tangentMode: 136 68 | m_PreInfinity: 2 69 | m_PostInfinity: 2 70 | m_RotationOrder: 4 71 | attribute: m_Pivot.y 72 | path: 73 | classID: 224 74 | script: {fileID: 0} 75 | m_PPtrCurves: [] 76 | m_SampleRate: 60 77 | m_WrapMode: 0 78 | m_Bounds: 79 | m_Center: {x: 0, y: 0, z: 0} 80 | m_Extent: {x: 0, y: 0, z: 0} 81 | m_ClipBindingConstant: 82 | genericBindings: [] 83 | pptrCurveMapping: [] 84 | m_AnimationClipSettings: 85 | serializedVersion: 2 86 | m_AdditiveReferencePoseClip: {fileID: 0} 87 | m_AdditiveReferencePoseTime: 0 88 | m_StartTime: 0 89 | m_StopTime: 1 90 | m_OrientationOffsetY: 0 91 | m_Level: 0 92 | m_CycleOffset: 0 93 | m_HasAdditiveReferencePose: 0 94 | m_LoopTime: 1 95 | m_LoopBlend: 0 96 | m_LoopBlendOrientation: 0 97 | m_LoopBlendPositionY: 0 98 | m_LoopBlendPositionXZ: 0 99 | m_KeepOriginalOrientation: 0 100 | m_KeepOriginalPositionY: 1 101 | m_KeepOriginalPositionXZ: 0 102 | m_HeightFromFeet: 0 103 | m_Mirror: 0 104 | m_EditorCurves: 105 | - curve: 106 | serializedVersion: 2 107 | m_Curve: 108 | - serializedVersion: 2 109 | time: 0 110 | value: 0 111 | inSlope: 0 112 | outSlope: 0 113 | tangentMode: 136 114 | - serializedVersion: 2 115 | time: 1 116 | value: 0 117 | inSlope: 0 118 | outSlope: 0 119 | tangentMode: 136 120 | m_PreInfinity: 2 121 | m_PostInfinity: 2 122 | m_RotationOrder: 4 123 | attribute: m_Pivot.x 124 | path: 125 | classID: 224 126 | script: {fileID: 0} 127 | - curve: 128 | serializedVersion: 2 129 | m_Curve: 130 | - serializedVersion: 2 131 | time: 0 132 | value: 1 133 | inSlope: 0 134 | outSlope: 0 135 | tangentMode: 136 136 | - serializedVersion: 2 137 | time: 0.16666667 138 | value: 0 139 | inSlope: -3 140 | outSlope: -3 141 | tangentMode: 34 142 | - serializedVersion: 2 143 | time: 0.8333333 144 | value: 0 145 | inSlope: 2.9999998 146 | outSlope: 2.9999998 147 | tangentMode: 34 148 | - serializedVersion: 2 149 | time: 1 150 | value: 1 151 | inSlope: 0 152 | outSlope: 0 153 | tangentMode: 136 154 | m_PreInfinity: 2 155 | m_PostInfinity: 2 156 | m_RotationOrder: 4 157 | attribute: m_Pivot.y 158 | path: 159 | classID: 224 160 | script: {fileID: 0} 161 | m_EulerEditorCurves: [] 162 | m_HasGenericRootTransform: 0 163 | m_HasMotionFloatCurves: 0 164 | m_GenerateMotionCurves: 0 165 | m_Events: [] 166 | -------------------------------------------------------------------------------- /sample/Assets/Animations/Pop.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66ca039008f544b94b05df0db598870f 3 | timeCreated: 1577032019 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 7400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /sample/Assets/Sample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13305894bc19a4c0b9628a8b5b587b99 3 | -------------------------------------------------------------------------------- /sample/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9d4cb6c6feef4d4183a034936af7987 3 | -------------------------------------------------------------------------------- /sample/Assets/Scripts/SampleCustomHeader.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | /// 7 | /// Example for Custom header features. 8 | /// If you want to try custom headers, put this class as a component to the scene. 9 | /// 10 | public class SampleCustomHeader : MonoBehaviour 11 | { 12 | const float BUTTON_HEIGHT = 50.0f; 13 | const string CUSTOM_HEADER_KEY_NAME = "custom_timestamp"; 14 | 15 | WebViewObject _webviewObject; 16 | 17 | // Use this for initialization 18 | void Start() 19 | { 20 | } 21 | 22 | // Update is called once per frame 23 | void Update() 24 | { 25 | 26 | } 27 | 28 | void OnGUI() 29 | { 30 | float h = Screen.height; 31 | if (GUI.Button(new Rect(.0f, h - BUTTON_HEIGHT, Screen.width, BUTTON_HEIGHT), "check for request header")) 32 | { 33 | this._webviewObject = GameObject.Find("WebViewObject").GetComponent(); 34 | this._webviewObject.LoadURL("http://httpbin.org/headers"); 35 | } 36 | h -= BUTTON_HEIGHT; 37 | 38 | if (GUI.Button(new Rect(.0f, h - BUTTON_HEIGHT, Screen.width, BUTTON_HEIGHT), "add custom header")) 39 | { 40 | this._webviewObject = GameObject.Find("WebViewObject").GetComponent(); 41 | this._webviewObject.AddCustomHeader(CUSTOM_HEADER_KEY_NAME, System.DateTime.Now.ToString()); 42 | } 43 | h -= BUTTON_HEIGHT; 44 | 45 | if (GUI.Button(new Rect(.0f, h - BUTTON_HEIGHT, Screen.width, BUTTON_HEIGHT), "get custom header")) 46 | { 47 | this._webviewObject = GameObject.Find("WebViewObject").GetComponent(); 48 | Debug.Log("custom_timestamp is " + this._webviewObject.GetCustomHeaderValue(CUSTOM_HEADER_KEY_NAME)); 49 | } 50 | h -= BUTTON_HEIGHT; 51 | 52 | if (GUI.Button(new Rect(.0f, h - BUTTON_HEIGHT, Screen.width, BUTTON_HEIGHT), "remove custom header")) 53 | { 54 | this._webviewObject = GameObject.Find("WebViewObject").GetComponent(); 55 | this._webviewObject.RemoveCustomHeader(CUSTOM_HEADER_KEY_NAME); 56 | } 57 | h -= BUTTON_HEIGHT; 58 | 59 | if (GUI.Button(new Rect(.0f, h - BUTTON_HEIGHT, Screen.width, BUTTON_HEIGHT), "clear custom header")) 60 | { 61 | this._webviewObject = GameObject.Find("WebViewObject").GetComponent(); 62 | this._webviewObject.ClearCustomHeader(); 63 | } 64 | h -= BUTTON_HEIGHT; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sample/Assets/Scripts/SampleCustomHeader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27eca8138129a4200a8e091c1e06e6df 3 | timeCreated: 1491357593 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /sample/Assets/Scripts/SampleWebView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb516f7ac0cee4b0f8345a5a60de3f42 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | -------------------------------------------------------------------------------- /sample/Assets/StreamingAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d93a031905d304de78c89dc088b975f5 3 | folderAsset: yes 4 | timeCreated: 1441033088 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /sample/Assets/StreamingAssets/sample.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Unity WebView 5 | 6 | 19 | 20 | 21 |

Hello Unity WebView!

22 |
23 |

https://google.com (for testing go/back buttons)

24 |

http://httpbin.org/headers (for testing custom headers.)

25 |

(local image)

26 |

Test saveDataURL (experimental, only for Android/iOS)

27 |
28 |
[]
29 |

[Send Message!]

30 |
31 | 32 |
33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /sample/Assets/StreamingAssets/sample.html.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9faa7687fef84e5ab19565b8e1c59a8 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /sample/Assets/StreamingAssets/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/sample/Assets/StreamingAssets/sample.jpg -------------------------------------------------------------------------------- /sample/Assets/StreamingAssets/sample.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83336034623b9413ba8944ff0bf0b101 3 | timeCreated: 1468552565 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /sample/Assets/StreamingAssets/sample.js: -------------------------------------------------------------------------------- 1 | window.addEventListener( 2 | 'load', 3 | function() { 4 | document.body.style.backgroundColor = 'white'; 5 | window.setTimeout( 6 | function() { 7 | document.body.style.backgroundColor = '#ABEBC6'; 8 | var msg = document.getElementById("msg"); 9 | msg.textContent = '(NOTE: the background color was changed by sample.js, for checking whether the external js code works)'; 10 | }, 11 | 3000); 12 | }); 13 | function testSaveDataURL() { 14 | var canvas = document.createElement('canvas'); 15 | canvas.width = 320; 16 | canvas.height = 240; 17 | var ctx = canvas.getContext("2d"); 18 | ctx.fillStyle = "#fffaf0"; 19 | ctx.fillRect(0, 0, 320, 240); 20 | ctx.fillStyle = "#000000"; 21 | ctx.font = "48px serif"; 22 | ctx.strokeText("Hello, world", 40, 132); 23 | Unity.saveDataURL("test.png", canvas.toDataURL()); 24 | // NOTE: Unity.saveDataURL() for iOS cannot save a file under the common Downloads folder. 25 | // cf. https://github.com/gree/unity-webview/pull/904#issue-1650406563 26 | }; 27 | -------------------------------------------------------------------------------- /sample/Assets/StreamingAssets/sample.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9cc631d3c6bd45b7842960e19ae2de7 3 | timeCreated: 1514164698 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /sample/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_DisableAudio: 0 15 | -------------------------------------------------------------------------------- /sample/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /sample/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042, z: 0} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_BounceThreshold: 2 9 | m_SleepThreshold: .00499999989 10 | m_DefaultContactOffset: .00999999978 11 | m_SolverIterationCount: 6 12 | m_RaycastsHitTriggers: 1 13 | m_EnableAdaptiveForce: 0 14 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 15 | -------------------------------------------------------------------------------- /sample/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Sample.unity 10 | -------------------------------------------------------------------------------- /sample/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 0 12 | m_SpritePackerMode: 2 13 | m_SpritePackerPaddingPower: 1 14 | -------------------------------------------------------------------------------- /sample/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | -------------------------------------------------------------------------------- /sample/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /sample/ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gree/unity-webview/a12e2e6a53538ebe1a9a9781f7103a53dd987a55/sample/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /sample/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /sample/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_VelocityIterations: 8 9 | m_PositionIterations: 3 10 | m_VelocityThreshold: 1 11 | m_MaxLinearCorrection: .200000003 12 | m_MaxAngularCorrection: 8 13 | m_MaxTranslationSpeed: 100 14 | m_MaxRotationSpeed: 360 15 | m_MinPenetrationForPenalty: .00999999978 16 | m_BaumgarteScale: .200000003 17 | m_BaumgarteTimeOfImpactScale: .75 18 | m_TimeToSleep: .5 19 | m_LinearSleepTolerance: .00999999978 20 | m_AngularSleepTolerance: 2 21 | m_RaycastsHitTriggers: 1 22 | m_RaycastsStartInColliders: 1 23 | m_ChangeStopsCallbacks: 0 24 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 25 | -------------------------------------------------------------------------------- /sample/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.6.7f1 2 | -------------------------------------------------------------------------------- /sample/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowCascade2Split: .333333343 18 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 19 | blendWeights: 1 20 | textureQuality: 1 21 | anisotropicTextures: 0 22 | antiAliasing: 0 23 | softParticles: 0 24 | softVegetation: 0 25 | realtimeReflectionProbes: 0 26 | billboardsFaceCameraPosition: 0 27 | vSyncCount: 0 28 | lodBias: .300000012 29 | maximumLODLevel: 0 30 | particleRaycastBudget: 4 31 | excludedTargetPlatforms: [] 32 | - serializedVersion: 2 33 | name: Fast 34 | pixelLightCount: 0 35 | shadows: 0 36 | shadowResolution: 0 37 | shadowProjection: 1 38 | shadowCascades: 1 39 | shadowDistance: 20 40 | shadowCascade2Split: .333333343 41 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 42 | blendWeights: 2 43 | textureQuality: 0 44 | anisotropicTextures: 0 45 | antiAliasing: 0 46 | softParticles: 0 47 | softVegetation: 0 48 | realtimeReflectionProbes: 0 49 | billboardsFaceCameraPosition: 0 50 | vSyncCount: 0 51 | lodBias: .400000006 52 | maximumLODLevel: 0 53 | particleRaycastBudget: 16 54 | excludedTargetPlatforms: [] 55 | - serializedVersion: 2 56 | name: Simple 57 | pixelLightCount: 1 58 | shadows: 1 59 | shadowResolution: 0 60 | shadowProjection: 1 61 | shadowCascades: 1 62 | shadowDistance: 20 63 | shadowCascade2Split: .333333343 64 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 65 | blendWeights: 2 66 | textureQuality: 0 67 | anisotropicTextures: 1 68 | antiAliasing: 0 69 | softParticles: 0 70 | softVegetation: 0 71 | realtimeReflectionProbes: 0 72 | billboardsFaceCameraPosition: 0 73 | vSyncCount: 0 74 | lodBias: .699999988 75 | maximumLODLevel: 0 76 | particleRaycastBudget: 64 77 | excludedTargetPlatforms: [] 78 | - serializedVersion: 2 79 | name: Good 80 | pixelLightCount: 2 81 | shadows: 2 82 | shadowResolution: 1 83 | shadowProjection: 1 84 | shadowCascades: 2 85 | shadowDistance: 40 86 | shadowCascade2Split: .333333343 87 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 88 | blendWeights: 2 89 | textureQuality: 0 90 | anisotropicTextures: 1 91 | antiAliasing: 0 92 | softParticles: 0 93 | softVegetation: 1 94 | realtimeReflectionProbes: 1 95 | billboardsFaceCameraPosition: 1 96 | vSyncCount: 1 97 | lodBias: 1 98 | maximumLODLevel: 0 99 | particleRaycastBudget: 256 100 | excludedTargetPlatforms: [] 101 | - serializedVersion: 2 102 | name: Beautiful 103 | pixelLightCount: 3 104 | shadows: 2 105 | shadowResolution: 2 106 | shadowProjection: 1 107 | shadowCascades: 2 108 | shadowDistance: 70 109 | shadowCascade2Split: .333333343 110 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 111 | blendWeights: 4 112 | textureQuality: 0 113 | anisotropicTextures: 2 114 | antiAliasing: 2 115 | softParticles: 1 116 | softVegetation: 1 117 | realtimeReflectionProbes: 1 118 | billboardsFaceCameraPosition: 1 119 | vSyncCount: 1 120 | lodBias: 1.5 121 | maximumLODLevel: 0 122 | particleRaycastBudget: 1024 123 | excludedTargetPlatforms: [] 124 | - serializedVersion: 2 125 | name: Fantastic 126 | pixelLightCount: 4 127 | shadows: 2 128 | shadowResolution: 2 129 | shadowProjection: 1 130 | shadowCascades: 4 131 | shadowDistance: 150 132 | shadowCascade2Split: .333333343 133 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 134 | blendWeights: 4 135 | textureQuality: 0 136 | anisotropicTextures: 2 137 | antiAliasing: 2 138 | softParticles: 1 139 | softVegetation: 1 140 | realtimeReflectionProbes: 1 141 | billboardsFaceCameraPosition: 1 142 | vSyncCount: 1 143 | lodBias: 2 144 | maximumLODLevel: 0 145 | particleRaycastBudget: 4096 146 | excludedTargetPlatforms: [] 147 | m_PerPlatformDefaultQuality: 148 | Android: 2 149 | FlashPlayer: 3 150 | GLES Emulation: 3 151 | PS3: 3 152 | Standalone: 3 153 | Web: 3 154 | Wii: 3 155 | XBOX360: 3 156 | iPhone: 2 157 | -------------------------------------------------------------------------------- /sample/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /sample/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: .0199999996 7 | Maximum Allowed Timestep: .333333343 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /sample/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | CrashReportingSettings: 11 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 12 | m_Enabled: 0 13 | m_CaptureEditorExceptions: 1 14 | UnityPurchasingSettings: 15 | m_Enabled: 0 16 | m_TestMode: 0 17 | UnityAnalyticsSettings: 18 | m_Enabled: 0 19 | m_InitializeOnStartup: 1 20 | m_TestMode: 0 21 | m_TestEventUrl: 22 | m_TestConfigUrl: 23 | UnityAdsSettings: 24 | m_Enabled: 0 25 | m_InitializeOnStartup: 1 26 | m_TestMode: 0 27 | m_EnabledPlatforms: 4294967295 28 | m_IosGameId: 29 | m_AndroidGameId: 30 | --------------------------------------------------------------------------------