master 16c7cdb26634 cached
68 files
29.2 KB
9.3k tokens
47 symbols
1 requests
Download .txt
Repository: keijiro/unity-webview-integration
Branch: master
Commit: 16c7cdb26634
Files: 68
Total size: 29.2 KB

Directory structure:
gitextract_rbtyjkwj/

├── .gitignore
├── LICENSE.txt
├── README.md
├── android/
│   ├── AndroidManifest.xml
│   ├── ant.properties
│   ├── build.xml
│   ├── libs/
│   │   └── UnityClasses.jar
│   ├── project.properties
│   ├── res/
│   │   ├── layout/
│   │   │   └── main.xml
│   │   └── values/
│   │       └── strings.xml
│   └── src/
│       └── jp/
│           └── radiumsoftware/
│               └── unitywebviewexample/
│                   └── ExtendedUnityPlayerActivity.java
└── unity/
    ├── Assets/
    │   ├── GUI/
    │   │   ├── Default GUI SKin.guiskin
    │   │   ├── Default GUI SKin.guiskin.meta
    │   │   ├── SU3DJPFont/
    │   │   │   ├── Fonts/
    │   │   │   │   └── s1-mplus-1c-light.ttf.meta
    │   │   │   ├── Fonts.meta
    │   │   │   ├── license.txt
    │   │   │   ├── license.txt.meta
    │   │   │   ├── readme.txt
    │   │   │   └── readme.txt.meta
    │   │   └── SU3DJPFont.meta
    │   ├── GUI.meta
    │   ├── Main.unity
    │   ├── Main.unity.meta
    │   ├── Materials/
    │   │   ├── Blue Box.mat
    │   │   ├── Blue Box.mat.meta
    │   │   ├── Floor.mat
    │   │   ├── Floor.mat.meta
    │   │   ├── Red Box.mat
    │   │   └── Red Box.mat.meta
    │   ├── Materials.meta
    │   ├── Physics/
    │   │   ├── Default Physic Material.physicMaterial
    │   │   └── Default Physic Material.physicMaterial.meta
    │   ├── Physics.meta
    │   ├── Plugins/
    │   │   ├── Android/
    │   │   │   ├── AndroidManifest.xml
    │   │   │   ├── AndroidManifest.xml.meta
    │   │   │   ├── WebViewIntegration.jar
    │   │   │   └── WebViewIntegration.jar.meta
    │   │   ├── Android.meta
    │   │   ├── WebMediator.js
    │   │   ├── WebMediator.js.meta
    │   │   ├── iOS/
    │   │   │   ├── WebViewPlugin.mm
    │   │   │   └── WebViewPlugin.mm.meta
    │   │   └── iOS.meta
    │   ├── Plugins.meta
    │   ├── Prefabs/
    │   │   ├── Blue Box.prefab
    │   │   ├── Blue Box.prefab.meta
    │   │   ├── Red Box.prefab
    │   │   └── Red Box.prefab.meta
    │   ├── Prefabs.meta
    │   ├── Scripts/
    │   │   ├── Box.js
    │   │   ├── Box.js.meta
    │   │   ├── TestInterface.js
    │   │   └── TestInterface.js.meta
    │   ├── Scripts.meta
    │   ├── Textures/
    │   │   ├── Board.png.meta
    │   │   └── Checker2.png.meta
    │   └── Textures.meta
    └── ProjectSettings/
        ├── AudioManager.asset
        ├── DynamicsManager.asset
        ├── EditorBuildSettings.asset
        ├── EditorSettings.asset
        ├── InputManager.asset
        ├── NavMeshLayers.asset
        ├── NetworkManager.asset
        ├── ProjectSettings.asset
        ├── QualitySettings.asset
        ├── TagManager.asset
        └── TimeManager.asset

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.DS_Store
*.swp
android/bin/*
android/gen
android/proguard.cfg
android/local.properties
unity/Library
unity/Temp


================================================
FILE: LICENSE.txt
================================================
Copyright (C) 2011 Keijiro Takahashi

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.


================================================
FILE: README.md
================================================
### 概要

Unity iOS および Android において web view を画面内に組み込み、その内部と連携を行うためのプラグインの実装例です。

![screenshot](https://github.com/downloads/keijiro/unity-webview-integration/IMG_0004.jpg)

上図は実装されたサンプルシーンを実行した様子です。上部が Unity の画面で、下部が web view です。Web view 内のリンクをクリックすることにより Unity 画面内で特定のアクションが発動されます。

### 簡単な解説

#### Unity 側

[Assets/Plugins/WebMediator.js](https://github.com/keijiro/unity-webview-integration/blob/master/unity/Assets/Plugins/WebMediator.js) が Unity 側の窓口となるスクリプトです。このスクリプトを通して web view の表示制御、配置マージン設定、指定 URL のロードを行うことができます。また、web view 内から送信されたメッセージをここから拾い上げることができます。詳しい使用方法についてはサンプルプロジェクトの [TestInterface.js](https://github.com/keijiro/unity-webview-integration/blob/master/unity/Assets/Scripts/TestInterface.js) を参照してください。

#### Web view 側

Web view 側からメッセージを送信するには [unity.js](https://github.com/keijiro/unity-webview-integration/blob/gh-pages/unity.js) をインポートし、この中で定義されている `UnityWebMediator` クラスを用いる必要があります。詳しい使用方法についてはサンプルプロジェクトの [index.html](https://github.com/keijiro/unity-webview-integration/blob/gh-pages/index.html) を参照してください。


================================================
FILE: android/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="jp.radiumsoftware.unitywebviewexample"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <activity android:name="ACTIVITY_ENTRY_NAME"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


================================================
FILE: android/ant.properties
================================================
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.

# This file is only used by the Ant script.

# You can use this to override default values such as
#  'source.dir' for the location of your java source folder and
#  'out.dir' for the location of your output folder.

# You can also use it define how the release builds are signed by declaring
# the following properties:
#  'key.store' for the location of your keystore and
#  'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.



================================================
FILE: android/build.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="WebMediator" default="help">

    <!-- The local.properties file is created and updated by the 'android' tool.
         It contains the path to the SDK. It should *NOT* be checked into
         Version Control Systems. -->
    <loadproperties srcFile="local.properties" />

    <!-- The ant.properties file can be created by you. It is only edited by the
         'android' tool to add properties to it.
         This is the place to change some Ant specific build properties.
         Here are some properties you may want to change/update:

         source.dir
             The name of the source directory. Default is 'src'.
         out.dir
             The name of the output directory. Default is 'bin'.

         For other overridable properties, look at the beginning of the rules
         files in the SDK, at tools/ant/build.xml

         Properties related to the SDK location or the project target should
         be updated using the 'android' tool with the 'update' action.

         This file is an integral part of the build system for your
         application and should be checked into Version Control Systems.

         -->
    <property file="ant.properties" />

    <!-- The project.properties file is created and updated by the 'android'
         tool, as well as ADT.

         This contains project specific properties such as project target, and library
         dependencies. Lower level build properties are stored in ant.properties
         (or in .classpath for Eclipse projects).

         This file is an integral part of the build system for your
         application and should be checked into Version Control Systems. -->
    <loadproperties srcFile="project.properties" />

    <!-- quick check on sdk.dir -->
    <fail
            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
            unless="sdk.dir"
    />


<!-- extension targets. Uncomment the ones where you want to do custom work
     in between standard targets -->
<!--
    <target name="-pre-build">
    </target>
    <target name="-pre-compile">
    </target>

    /* This is typically used for code obfuscation.
       Compiled code location: ${out.classes.absolute.dir}
       If this is not done in place, override ${out.dex.input.absolute.dir} */
    <target name="-post-compile">
    </target>
-->

    <!-- Import the actual build file.

         To customize existing targets, there are two options:
         - Customize only one target:
             - copy/paste the target into this file, *before* the
               <import> task.
             - customize it to your needs.
         - Customize the whole content of build.xml
             - copy/paste the content of the rules files (minus the top node)
               into this file, replacing the <import> task.
             - customize to your needs.

         ***********************
         ****** IMPORTANT ******
         ***********************
         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
         in order to avoid having your file be overridden by tools such as "android update project"
    -->
    <!-- version-tag: 1 -->
    <import file="${sdk.dir}/tools/ant/build.xml" />

</project>


================================================
FILE: android/project.properties
================================================
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

android.library=true
# Project target.
target=android-7


================================================
FILE: android/res/layout/main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Hello World, ACTIVITY_ENTRY_NAME"
    />
</LinearLayout>



================================================
FILE: android/res/values/strings.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">ACTIVITY_ENTRY_NAME</string>
</resources>


================================================
FILE: android/src/jp/radiumsoftware/unitywebviewexample/ExtendedUnityPlayerActivity.java
================================================
// UnityPlayerActivity and WebView integration

package jp.radiumsoftware.unitywebviewexample;

import com.unity3d.player.UnityPlayerActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import java.lang.InterruptedException;
import java.util.concurrent.SynchronousQueue;

public class ExtendedUnityPlayerActivity extends UnityPlayerActivity {

    // JavaScript interface class for embedded WebView.
    private class JSInterface {
        public SynchronousQueue<String> mMessageQueue;

        JSInterface() {
            mMessageQueue = new SynchronousQueue<String>();
        }

        public void pushMessage(String message) {
            Log.d("WebView", message);
            try {
                mMessageQueue.put(message);
            } catch (java.lang.InterruptedException e) {
                Log.d("WebView", "Queueing error - " + e.getMessage());
            }
        }
    }

    private JSInterface mJSInterface;   // JavaScript interface (message receiver)
    private WebView mWebView;           // WebView object
    private ProgressBar mProgress;      // Progress bar
    private int mLeftMargin;            // Margins around the WebView
    private int mTopMargin;
    private int mRightMargin;
    private int mBottomMargin;
    private boolean mInitialLoad;       // Initial load flag

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Create a WebView and make layout.
        mWebView = new WebView(this);
        FrameLayout layout = new FrameLayout(this);
        addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        layout.addView(mWebView, new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, Gravity.NO_GRAVITY));
        // Basic settings of WebView.
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setSupportZoom(false);
        webSettings.setJavaScriptEnabled(true);
        webSettings.setPluginsEnabled(true);
        //webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
        // Set a dummy WebViewClient (which enables loading a new page in own WebView).
        mWebView.setWebViewClient(new WebViewClient(){});
        // Add a progress bar.
        mProgress = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal);
        layout.addView(mProgress, new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, 5));
        mProgress.setMax(100);
        mProgress.setVisibility(View.GONE);
        mWebView.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress) {
                if (progress < 100) {
                    mProgress.setVisibility(View.VISIBLE);
                    mProgress.setProgress(progress);
                } else {
                    mProgress.setVisibility(View.GONE);
                }
            }
        });
        // Create a JavaScript interface and bind the WebView to it.
        mJSInterface = new JSInterface();
        mWebView.addJavascriptInterface(mJSInterface, "UnityInterface");
        // Start in invisible state.
        mWebView.setVisibility(View.GONE);
    }

    public void updateWebView(final String lastRequestedUrl, final boolean loadRequest, final boolean visibility, final int leftMargin, final int topMargin, final int rightMargin, final int bottomMargin) {
        // Process load requests.
        if (lastRequestedUrl != null && (loadRequest || !mInitialLoad)) {
            runOnUiThread(new Runnable() {
                public void run() {
                    mWebView.loadUrl(lastRequestedUrl);
                }
            });
            mInitialLoad = true;
        }
        // Process changes in margin amounts.
        if (leftMargin != mLeftMargin || topMargin != mTopMargin || rightMargin != mRightMargin || bottomMargin != mBottomMargin) {
            mLeftMargin = leftMargin;
            mTopMargin = topMargin;
            mRightMargin = rightMargin;
            mBottomMargin = bottomMargin;
            runOnUiThread(new Runnable() {
                public void run() {
                    // Apply a new layout to the WebView.
                    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT, Gravity.NO_GRAVITY);
                    params.setMargins(mLeftMargin, mTopMargin, mRightMargin, mBottomMargin);
                    mWebView.setLayoutParams(params);
                }
            });
        }
        // Process changes in visibility.
        if (visibility != (mWebView.getVisibility() == View.VISIBLE)) {
            runOnUiThread(new Runnable() {
                public void run() {
                    if (visibility) {
                        // Show and set focus.
                        mWebView.setVisibility(View.VISIBLE);
                        mWebView.requestFocus();
                    } else {
                        // Hide.
                        mWebView.setVisibility(View.GONE);
                    }
                }
            });
        }
    }

    public String pollWebViewMessage() {
        return mJSInterface.mMessageQueue.poll();
    }
    
    // Transparent background
    public void makeTransparentWebViewBackground() {
        mWebView.setBackgroundColor(Color.TRANSPARENT);
    }
} 


================================================
FILE: unity/Assets/GUI/Default GUI SKin.guiskin.meta
================================================
fileFormatVersion: 1
guid: ecaca87ebef4e4961ab66cf142175f61


================================================
FILE: unity/Assets/GUI/SU3DJPFont/Fonts/s1-mplus-1c-light.ttf.meta
================================================
fileFormatVersion: 1
guid: 596c1fd1351a65540b8f6baeb5c83ccb
TrueTypeFontImporter:
  importerVersion: 1
  size: 16
  case: -1
  antiAlias: 0
  includeFontData: 1
  use2xBehaviour: 0
  style: 0
  fontNames:
    name: 


================================================
FILE: unity/Assets/GUI/SU3DJPFont/Fonts.meta
================================================
fileFormatVersion: 1
guid: 9e26e0c931f64c44799647ea7fd00b96


================================================
FILE: unity/Assets/GUI/SU3DJPFont/license.txt
================================================
LICENSE

These fonts are free softwares. 
Unlimited permission is granted to use, copy, and distribute it, with or without modification, either commercially and noncommercially. 
THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY. 

これらのフォントはフリー(自由な)ソフトウエアです。 
あらゆる改変の有無に関わらず、また商業的な利用であっても、自由にご利用、複製、再配布することができますが、全て無保証とさせていただきます。 



================================================
FILE: unity/Assets/GUI/SU3DJPFont/license.txt.meta
================================================
fileFormatVersion: 1
guid: 876dd09a256784345be2d6045b6571a3


================================================
FILE: unity/Assets/GUI/SU3DJPFont/readme.txt
================================================

Selected U3D Japanese Fonts   05/17/2011

------------------------------------------------------------------------
# English

  Selected U3D Japanese Fonts is based on M+OUTLINE Font TESTFLIGHT039 M+C.
  Characters are selected so that it may fit in the optimal texture size for mobile devices.
  It can have the characters of the size of 25 points in the 1024x1024 texture size.

  The following groups are contained in this asset.

  * Hiragana
  * Katakana
  * Alphabet , Number , Mark
  * 1,006 Kanji taught in Japanese primary schools
  * 132 Kanji in Japan states name and game words

  All the lists of characters are recorded on "list.txt".

  A question, a request, etc. to Selected U3D Japanese Fonts should inform the following address.
    http://www.futurecartographer.com/
    masashi_wada@dearna.com

  Refer to the following URL for the details about M+OUTLINE Fonts. 
    http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index-en.html


------------------------------------------------------------------------
# Japanese ( 日本語 )

  Selected U3D Japanese Fontsは M+OUTLINEフォントTESTFLIGHT039 M+Cを基盤にしています。
  主にモバイル機器に最適な文字サイズとテクスチャサイズを両立するために、
  フォントに含む文字を以下に限定して再構成したTTFファイルです。
  これらの文字セットによって、1024x1024のテクスチャであっても、25ポイントまでの大きさを保てる特徴があります。

  ・ひらがな
  ・カタカナ
  ・アルファベット、数字、記号
  ・小学校6年生までの教育漢字(1006文字)
  ・都道府県表記、ゲーム用語に適した漢字 (132文字)

  フォントに含まれる全ての文字のリストは list.txt に記載しています。

 Selected U3D Japanese Fontsに関する質問、要望などは次のアドレスに連絡をしてください。
    http://www.futurecartographer.com/
    masashi_wada@dearna.com

  M+OUTLINEフォントに関する詳細は次のURLを参照してください。
    http://mplus-fonts.sourceforge.jp/mplus-outline-fonts/index.html



================================================
FILE: unity/Assets/GUI/SU3DJPFont/readme.txt.meta
================================================
fileFormatVersion: 1
guid: 4a4f1ada9e7459344bc4acb002b22a4b


================================================
FILE: unity/Assets/GUI/SU3DJPFont.meta
================================================
fileFormatVersion: 1
guid: 2c7ff880dcb39c14199433ad6846d37b


================================================
FILE: unity/Assets/GUI.meta
================================================
fileFormatVersion: 1
guid: 3a3b1c6f5244d498e95e41026452dc53


================================================
FILE: unity/Assets/Main.unity.meta
================================================
fileFormatVersion: 1
guid: 5dd8fad3f211b4f50aaee8743a63da4e


================================================
FILE: unity/Assets/Materials/Blue Box.mat.meta
================================================
fileFormatVersion: 1
guid: 905886db109bd4a36af150540c0bd0f1


================================================
FILE: unity/Assets/Materials/Floor.mat.meta
================================================
fileFormatVersion: 1
guid: e06bb986f1a7e4dc6841f7cb59aeef8e


================================================
FILE: unity/Assets/Materials/Red Box.mat.meta
================================================
fileFormatVersion: 1
guid: ac8ade9aa523842fab3b893be999d08e


================================================
FILE: unity/Assets/Materials.meta
================================================
fileFormatVersion: 1
guid: eacdd09aa755f4bf6b6531b7af53dad5


================================================
FILE: unity/Assets/Physics/Default Physic Material.physicMaterial.meta
================================================
fileFormatVersion: 1
guid: daef168d6938746eda86db30cd78df40


================================================
FILE: unity/Assets/Physics.meta
================================================
fileFormatVersion: 1
guid: 046d56fdea7e34d05bbe1082f55a769d


================================================
FILE: unity/Assets/Plugins/Android/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="jp.radiumsoftware.unitywebviewexample"
	android:installLocation="preferExternal"
    android:versionCode="1"
    android:versionName="1.0">
    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"/>

    <application
		android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:debuggable="true">
        <activity android:name=".ExtendedUnityPlayerActivity"
                  android:label="@string/app_name"
                  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>


================================================
FILE: unity/Assets/Plugins/Android/AndroidManifest.xml.meta
================================================
fileFormatVersion: 1
guid: 50bf13cedd20a49f3b2ef3e88cf13d4f


================================================
FILE: unity/Assets/Plugins/Android/WebViewIntegration.jar.meta
================================================
fileFormatVersion: 1
guid: 94d9591b24ce3471383b7b7f121cb653


================================================
FILE: unity/Assets/Plugins/Android.meta
================================================
fileFormatVersion: 1
guid: 22aac9bb108084be8b2ffc5ec762342e


================================================
FILE: unity/Assets/Plugins/WebMediator.js
================================================
#pragma strict

// WebView-Unity mediator plugin script.

import System.Runtime.InteropServices;

// Message container class.
class WebMediatorMessage {
    var path : String;      // Message path
    var args : Hashtable;   // Argument table

    function WebMediatorMessage(rawMessage : String) {
        // Retrieve a path.
        var split = rawMessage.Split("?"[0]);
        path = split[0];
        // Parse arguments.
        args = new Hashtable();
        if (split.Length > 1) {
            for (var pair in split[1].Split("&"[0])) {
                var elems = pair.Split("="[0]);
                args[elems[0]] = WWW.UnEscapeURL(elems[1]);
            }
        }
    }
}

private static var instance : WebMediator;
private static var isClearCache : boolean;

private var lastRequestedUrl : String;
private var loadRequest : boolean;
private var visibility : boolean;
private var leftMargin : int;
private var topMargin : int;
private var rightMargin : int;
private var bottomMargin : int;

// Install the plugin.
// Call this at least once before using the plugin.
static function Install() {
    if (instance == null) {
        var master = new GameObject("WebMediator");
        DontDestroyOnLoad(master);
        instance = master.AddComponent.<WebMediator>();
        InstallPlatform();
    }
}

// Set margins around the web view.
static function SetMargin(left : int, top: int, right : int, bottom : int) {
    instance.leftMargin = left;
    instance.topMargin = top;
    instance.rightMargin = right;
    instance.bottomMargin = bottom;
    ApplyMarginsPlatform();
}

// Visibility functions.
static function Show() {
    instance.visibility = true;
}
static function Hide() {
    instance.visibility = false;
}
static function IsVisible() {
    return instance.visibility;
}

static function SetClearCache()
{
    isClearCache = true;
}

static function SetCache()
{
    isClearCache = false;
}

// Load the page at the URL.
static function LoadUrl(url : String) {
    instance.lastRequestedUrl = url;
    instance.loadRequest = true;
}

function Update() {
    UpdatePlatform();
    instance.loadRequest = false;
}

#if UNITY_EDITOR

// Unity Editor implementation.

private static function InstallPlatform() { }
private static function UpdatePlatform() { }
private static function ApplyMarginsPlatform() { }
static function PollMessage() : WebMediatorMessage { return null; }
static function MakeTransparentWebViewBackground() { }

#elif UNITY_IPHONE

// iOS platform implementation.

@DllImportAttribute("__Internal") static private function _WebViewPluginInstall() {}
@DllImportAttribute("__Internal") static private function _WebViewPluginLoadUrl(url : String, isClearCache : boolean) {}
@DllImportAttribute("__Internal") static private function _WebViewPluginSetVisibility(visibility : boolean) {}
@DllImportAttribute("__Internal") static private function _WebViewPluginSetMargins(left : int, top : int, right : int, bottom : int) {}
@DllImportAttribute("__Internal") static private function _WebViewPluginPollMessage() : String {}
@DllImportAttribute("__Internal") static private function _WebViewPluginMakeTransparentBackground() {}

private static var viewVisibility : boolean;

private static function InstallPlatform() {
    _WebViewPluginInstall();
}

private static function ApplyMarginsPlatform() {
    _WebViewPluginSetMargins(instance.leftMargin, instance.topMargin, instance.rightMargin, instance.bottomMargin);
}

private static function UpdatePlatform() {
    if (viewVisibility != instance.visibility) {
        viewVisibility = instance.visibility;
        _WebViewPluginSetVisibility(viewVisibility);
    }
    if (instance.loadRequest) {
        instance.loadRequest = false;
        _WebViewPluginLoadUrl(instance.lastRequestedUrl, isClearCache);
    }
}

static function PollMessage() : WebMediatorMessage {
    var message =  _WebViewPluginPollMessage();
    return message ? new WebMediatorMessage(message) : null;
}

static function MakeTransparentWebViewBackground()
{
    _WebViewPluginMakeTransparentBackground();
}

#elif UNITY_ANDROID

// Android platform implementation.

private static var unityPlayerClass : AndroidJavaClass;

private static function InstallPlatform() {
    unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
}

private static function ApplyMarginsPlatform() { }

private static function UpdatePlatform() {
    var activity = unityPlayerClass.GetStatic.<AndroidJavaObject>("currentActivity");
    activity.Call("updateWebView", instance.lastRequestedUrl ? instance.lastRequestedUrl : "", instance.loadRequest, instance.visibility, instance.leftMargin, instance.topMargin, instance.rightMargin, instance.bottomMargin);
}

static function PollMessage() : WebMediatorMessage {
    var activity = unityPlayerClass.GetStatic.<AndroidJavaObject>("currentActivity");
    var message = activity.Call.<String>("pollWebViewMessage");
    return message ? new WebMediatorMessage(message) : null;
}

static function MakeTransparentWebViewBackground()
{
    var activity = unityPlayerClass.GetStatic.<AndroidJavaObject>("currentActivity");
    activity.Call("makeTransparentWebViewBackground");
}

#endif


================================================
FILE: unity/Assets/Plugins/WebMediator.js.meta
================================================
fileFormatVersion: 1
guid: 9b61fa8dd1f9f40d9a0788beb93cd400


================================================
FILE: unity/Assets/Plugins/iOS/WebViewPlugin.mm
================================================
// Web view integration plug-in for Unity iOS.

#import <Foundation/Foundation.h>

extern UIViewController *UnityGetGLViewController(); // Root view controller of Unity screen.

#pragma mark Plug-in Functions

static UIWebView *webView;

extern "C" void _WebViewPluginInstall() {
    // Add the web view onto the root view (but don't show).
    UIViewController *rootViewController = UnityGetGLViewController();
    webView = [[UIWebView alloc] initWithFrame:rootViewController.view.frame];
    webView.hidden = YES;
    [rootViewController.view addSubview:webView];
}

extern "C" void _WebViewPluginMakeTransparentBackground() {
    [webView setBackgroundColor:[UIColor clearColor]];
    [webView setOpaque:NO];
}

extern "C" void _WebViewPluginLoadUrl(const char* url, boolean isClearCache) {
    if (isClearCache) {
        [[NSURLCache sharedURLCache] removeAllCachedResponses];
    }
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithUTF8String:url]]]];
}

extern "C" void _WebViewPluginSetVisibility(bool visibility) {
    webView.hidden = visibility ? NO : YES;
}

extern "C" void _WebViewPluginSetMargins(int left, int top, int right, int bottom) {
    UIViewController *rootViewController = UnityGetGLViewController();
    
    CGRect frame = rootViewController.view.frame;
    CGFloat scale = rootViewController.view.contentScaleFactor;
    
    CGRect screenBound = [[UIScreen mainScreen] bounds];
    CGSize screenSize = screenBound.size;
    // Obtaining the current device orientation
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    
    // landscape
    if (orientation) {
        frame.size.width = screenSize.height - (left + right) / scale;
        frame.size.height = screenSize.width - (top + bottom) / scale;
    } else { // portrait
        frame.size.width = screenSize.width - (left + right) / scale;
        frame.size.height = screenSize.height - (top + bottom) / scale;
    }
    
    frame.origin.x += left / scale;
    frame.origin.y += top / scale;

    webView.frame = frame;
}

extern "C" char *_WebViewPluginPollMessage() {
    // Try to retrieve a message from the message queue in JavaScript context.
    NSString *message = [webView stringByEvaluatingJavaScriptFromString:@"unityWebMediatorInstance.pollMessage()"];
    if (message && message.length > 0) {
        NSLog(@"UnityWebViewPlugin: %@", message);
        char* memory = static_cast<char*>(malloc(strlen(message.UTF8String) + 1));
        if (memory) strcpy(memory, message.UTF8String);
        return memory;
    } else {
        return NULL;
    }
}


================================================
FILE: unity/Assets/Plugins/iOS/WebViewPlugin.mm.meta
================================================
fileFormatVersion: 2
guid: 4fd761aa32d674f48b76101ac5cf8971


================================================
FILE: unity/Assets/Plugins/iOS.meta
================================================
fileFormatVersion: 2
guid: 9bde65d35751a4fa88830f764562c2bb


================================================
FILE: unity/Assets/Plugins.meta
================================================
fileFormatVersion: 1
guid: 04a4b0667591a44f6a9cc634795749cf


================================================
FILE: unity/Assets/Prefabs/Blue Box.prefab.meta
================================================
fileFormatVersion: 1
guid: c1a1ab85a23cd4ce1bdd3731ac0ab9dd


================================================
FILE: unity/Assets/Prefabs/Red Box.prefab.meta
================================================
fileFormatVersion: 1
guid: 74768062b89004afb801f11a7a523ca1


================================================
FILE: unity/Assets/Prefabs.meta
================================================
fileFormatVersion: 1
guid: 9eb3019c10b364779925ef1ec161fb47


================================================
FILE: unity/Assets/Scripts/Box.js
================================================
#pragma strict

function Update() {
    if (transform.position.y < -2.0) Destroy(gameObject);
}


================================================
FILE: unity/Assets/Scripts/Box.js.meta
================================================
fileFormatVersion: 1
guid: 5f957e7e7cda347e0bbfaf9c31ec781d


================================================
FILE: unity/Assets/Scripts/TestInterface.js
================================================
#pragma strict

var guiSkin : GUISkin;
var redBoxPrefab : GameObject;
var blueBoxPrefab : GameObject;

private var note : String;

// Show the web view (with margins) and load the index page.
private function ActivateWebView() {
    WebMediator.LoadUrl("http://keijiro.github.com/unity-webview-integration/index.html");
    WebMediator.SetMargin(12, Screen.height / 2 + 12, 12, 12);
    WebMediator.Show();
}

// Hide the web view.
private function DeactivateWebView() {
    WebMediator.Hide();
    // Clear the state of the web view (by loading a blank page).
    WebMediator.LoadUrl("about:blank");
}

// Process messages coming from the web view.
private function ProcessMessages() {
    while (true) {
        // Poll a message or break.
        var message = WebMediator.PollMessage();
        if (!message) break;

        if (message.path == "/spawn") {
            // "spawn" message.
            if (message.args.ContainsKey("color")) {
                var prefab = (message.args["color"] == "red") ? redBoxPrefab : blueBoxPrefab;
            } else {
                prefab = Random.value < 0.5 ? redBoxPrefab : blueBoxPrefab;
            }
            var box = Instantiate(prefab, redBoxPrefab.transform.position, Random.rotation) as GameObject; 
            if (message.args.ContainsKey("scale")) {
                box.transform.localScale = Vector3.one * float.Parse(message.args["scale"] as String);
            }
        } else if (message.path == "/note") {
            // "note" message.
            note = message.args["text"] as String;
        } else if (message.path == "/print") {
            // "print" message.
            var text = message.args["line1"] as String;
            if (message.args.ContainsKey("line2")) {
                text += "\n" + message.args["line2"] as String;
            }
            Debug.Log(text);
            Debug.Log("(" + text.Length + " chars)");
        } else if (message.path == "/close") {
            // "close" message.
            DeactivateWebView();
        }
    }
}

function Start() {
    WebMediator.Install();
}

function Update() {
    if (WebMediator.IsVisible()) {
        ProcessMessages();
    } else if (Input.GetButtonDown("Fire1") && Input.mousePosition.y < Screen.height / 2) {
        ActivateWebView();
    }
}

function OnGUI() {
    var sw = Screen.width;
    var sh = Screen.height;
    GUI.skin = guiSkin;
    if (note) GUI.Label(Rect(0, 0, sw, 0.5 * sh), note);
    GUI.Label(Rect(0, 0.5 * sh, sw, 0.5 * sh), "TAP HERE", "center");
}


================================================
FILE: unity/Assets/Scripts/TestInterface.js.meta
================================================
fileFormatVersion: 1
guid: de41a1264b5be41c48fa4a0b821508b2


================================================
FILE: unity/Assets/Scripts.meta
================================================
fileFormatVersion: 1
guid: 6f9ab5fa22bd84d038705e7f6d302a8f


================================================
FILE: unity/Assets/Textures/Board.png.meta
================================================
fileFormatVersion: 1
guid: b9953bd5259dc48cc95acccd0f8c1228
TextureImporter:
  importerVersion: 1
  maxTextureSize: 1024
  textureFormat: -1
  grayscaleToAlpha: 0
  npotScale: 1
  generateCubemap: 0
  isReadable: 0
  mipmaps:
    generation: 1
    correctGamma: 0
    border: 0
    filter: 0
    fadeout: 0
    fadeoutStart: 1
    fadeoutEnd: 3
  bumpmap:
    generation: 0
    bumpyness: 0.25
    filter: 0
  textureSettings:
    filterMode: -1
    anisoLevel: -1
    mipmapBias: -1
    wrapMode: -1


================================================
FILE: unity/Assets/Textures/Checker2.png.meta
================================================
fileFormatVersion: 1
guid: a94bba682ebe648c08416aff1b18ad2e
TextureImporter:
  importerVersion: 2
  maxTextureSize: 1024
  textureFormat: -1
  grayscaleToAlpha: 0
  npotScale: 1
  generateCubemap: 0
  isReadable: 0
  textureType: 0
  mipmaps:
    generation: 1
    correctGamma: 0
    border: 0
    filter: 0
    fadeout: 0
    fadeoutStart: 1
    fadeoutEnd: 3
  bumpmap:
    generation: 0
    bumpyness: 0.25
    filter: 0
  textureSettings:
    filterMode: -1
    anisoLevel: -1
    mipmapBias: -1
    wrapMode: -1
  buildTargetSettings:
    iPhone:
      maxTextureSize: 128
      textureFormat: -3


================================================
FILE: unity/Assets/Textures.meta
================================================
fileFormatVersion: 1
guid: 28e2e9674dd404ef6ab51022aef57fc0
Download .txt
gitextract_rbtyjkwj/

├── .gitignore
├── LICENSE.txt
├── README.md
├── android/
│   ├── AndroidManifest.xml
│   ├── ant.properties
│   ├── build.xml
│   ├── libs/
│   │   └── UnityClasses.jar
│   ├── project.properties
│   ├── res/
│   │   ├── layout/
│   │   │   └── main.xml
│   │   └── values/
│   │       └── strings.xml
│   └── src/
│       └── jp/
│           └── radiumsoftware/
│               └── unitywebviewexample/
│                   └── ExtendedUnityPlayerActivity.java
└── unity/
    ├── Assets/
    │   ├── GUI/
    │   │   ├── Default GUI SKin.guiskin
    │   │   ├── Default GUI SKin.guiskin.meta
    │   │   ├── SU3DJPFont/
    │   │   │   ├── Fonts/
    │   │   │   │   └── s1-mplus-1c-light.ttf.meta
    │   │   │   ├── Fonts.meta
    │   │   │   ├── license.txt
    │   │   │   ├── license.txt.meta
    │   │   │   ├── readme.txt
    │   │   │   └── readme.txt.meta
    │   │   └── SU3DJPFont.meta
    │   ├── GUI.meta
    │   ├── Main.unity
    │   ├── Main.unity.meta
    │   ├── Materials/
    │   │   ├── Blue Box.mat
    │   │   ├── Blue Box.mat.meta
    │   │   ├── Floor.mat
    │   │   ├── Floor.mat.meta
    │   │   ├── Red Box.mat
    │   │   └── Red Box.mat.meta
    │   ├── Materials.meta
    │   ├── Physics/
    │   │   ├── Default Physic Material.physicMaterial
    │   │   └── Default Physic Material.physicMaterial.meta
    │   ├── Physics.meta
    │   ├── Plugins/
    │   │   ├── Android/
    │   │   │   ├── AndroidManifest.xml
    │   │   │   ├── AndroidManifest.xml.meta
    │   │   │   ├── WebViewIntegration.jar
    │   │   │   └── WebViewIntegration.jar.meta
    │   │   ├── Android.meta
    │   │   ├── WebMediator.js
    │   │   ├── WebMediator.js.meta
    │   │   ├── iOS/
    │   │   │   ├── WebViewPlugin.mm
    │   │   │   └── WebViewPlugin.mm.meta
    │   │   └── iOS.meta
    │   ├── Plugins.meta
    │   ├── Prefabs/
    │   │   ├── Blue Box.prefab
    │   │   ├── Blue Box.prefab.meta
    │   │   ├── Red Box.prefab
    │   │   └── Red Box.prefab.meta
    │   ├── Prefabs.meta
    │   ├── Scripts/
    │   │   ├── Box.js
    │   │   ├── Box.js.meta
    │   │   ├── TestInterface.js
    │   │   └── TestInterface.js.meta
    │   ├── Scripts.meta
    │   ├── Textures/
    │   │   ├── Board.png.meta
    │   │   └── Checker2.png.meta
    │   └── Textures.meta
    └── ProjectSettings/
        ├── AudioManager.asset
        ├── DynamicsManager.asset
        ├── EditorBuildSettings.asset
        ├── EditorSettings.asset
        ├── InputManager.asset
        ├── NavMeshLayers.asset
        ├── NetworkManager.asset
        ├── ProjectSettings.asset
        ├── QualitySettings.asset
        ├── TagManager.asset
        └── TimeManager.asset
Download .txt
SYMBOL INDEX (47 symbols across 4 files)

FILE: android/src/jp/radiumsoftware/unitywebviewexample/ExtendedUnityPlayerActivity.java
  class ExtendedUnityPlayerActivity (line 22) | public class ExtendedUnityPlayerActivity extends UnityPlayerActivity {
    class JSInterface (line 25) | private class JSInterface {
      method JSInterface (line 28) | JSInterface() {
      method pushMessage (line 32) | public void pushMessage(String message) {
    method onCreate (line 51) | protected void onCreate(Bundle savedInstanceState) {
    method updateWebView (line 88) | public void updateWebView(final String lastRequestedUrl, final boolean...
    method pollWebViewMessage (line 130) | public String pollWebViewMessage() {
    method makeTransparentWebViewBackground (line 135) | public void makeTransparentWebViewBackground() {

FILE: unity/Assets/Plugins/WebMediator.js
  class WebMediatorMessage (line 8) | class WebMediatorMessage {
    method WebMediatorMessage (line 12) | WebMediatorMessage(rawMessage : String) {
  function Install (line 40) | function Install() {
  function SetMargin (line 50) | function SetMargin(left : int, top: int, right : int, bottom : int) {
  function Show (line 59) | function Show() {
  function Hide (line 62) | function Hide() {
  function IsVisible (line 65) | function IsVisible() {
  function SetClearCache (line 69) | function SetClearCache()
  function SetCache (line 74) | function SetCache()
  function LoadUrl (line 80) | function LoadUrl(url : String) {
  function Update (line 85) | function Update() {
  function InstallPlatform (line 94) | function InstallPlatform() { }
  function UpdatePlatform (line 95) | function UpdatePlatform() { }
  function ApplyMarginsPlatform (line 96) | function ApplyMarginsPlatform() { }
  function PollMessage (line 97) | function PollMessage() : WebMediatorMessage { return null; }
  function MakeTransparentWebViewBackground (line 98) | function MakeTransparentWebViewBackground() { }
  function _WebViewPluginInstall (line 104) | function _WebViewPluginInstall() {}
  function _WebViewPluginLoadUrl (line 105) | function _WebViewPluginLoadUrl(url : String, isClearCache : boolean) {}
  function _WebViewPluginSetVisibility (line 106) | function _WebViewPluginSetVisibility(visibility : boolean) {}
  function _WebViewPluginSetMargins (line 107) | function _WebViewPluginSetMargins(left : int, top : int, right : int, bo...
  function _WebViewPluginPollMessage (line 108) | function _WebViewPluginPollMessage() : String {}
  function _WebViewPluginMakeTransparentBackground (line 109) | function _WebViewPluginMakeTransparentBackground() {}
  function InstallPlatform (line 113) | function InstallPlatform() {
  function ApplyMarginsPlatform (line 117) | function ApplyMarginsPlatform() {
  function UpdatePlatform (line 121) | function UpdatePlatform() {
  function PollMessage (line 132) | function PollMessage() : WebMediatorMessage {
  function MakeTransparentWebViewBackground (line 137) | function MakeTransparentWebViewBackground()
  function InstallPlatform (line 148) | function InstallPlatform() {
  function ApplyMarginsPlatform (line 152) | function ApplyMarginsPlatform() { }
  function UpdatePlatform (line 154) | function UpdatePlatform() {
  function PollMessage (line 159) | function PollMessage() : WebMediatorMessage {
  function MakeTransparentWebViewBackground (line 165) | function MakeTransparentWebViewBackground()

FILE: unity/Assets/Scripts/Box.js
  function Update (line 3) | function Update() {

FILE: unity/Assets/Scripts/TestInterface.js
  function ActivateWebView (line 10) | function ActivateWebView() {
  function DeactivateWebView (line 17) | function DeactivateWebView() {
  function ProcessMessages (line 24) | function ProcessMessages() {
  function Start (line 59) | function Start() {
  function Update (line 63) | function Update() {
  function OnGUI (line 71) | function OnGUI() {
Condensed preview — 68 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (35K chars).
[
  {
    "path": ".gitignore",
    "chars": 113,
    "preview": ".DS_Store\n*.swp\nandroid/bin/*\nandroid/gen\nandroid/proguard.cfg\nandroid/local.properties\nunity/Library\nunity/Temp\n"
  },
  {
    "path": "LICENSE.txt",
    "chars": 857,
    "preview": "Copyright (C) 2011 Keijiro Takahashi\n\nThis software is provided 'as-is', without any express or implied\nwarranty.  In no"
  },
  {
    "path": "README.md",
    "chars": 1037,
    "preview": "### 概要\n\nUnity iOS および Android において web view を画面内に組み込み、その内部と連携を行うためのプラグインの実装例です。\n\n![screenshot](https://github.com/downlo"
  },
  {
    "path": "android/AndroidManifest.xml",
    "chars": 672,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      packag"
  },
  {
    "path": "android/ant.properties",
    "chars": 696,
    "preview": "# This file is used to override default values used by the Ant build system.\n#\n# This file must be checked in Version Co"
  },
  {
    "path": "android/build.xml",
    "chars": 3334,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"WebMediator\" default=\"help\">\n\n    <!-- The local.properties file i"
  },
  {
    "path": "android/project.properties",
    "chars": 381,
    "preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
  },
  {
    "path": "android/res/layout/main.xml",
    "chars": 398,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "android/res/values/strings.xml",
    "chars": 121,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">ACTIVITY_ENTRY_NAME</string>\n</resources>"
  },
  {
    "path": "android/src/jp/radiumsoftware/unitywebviewexample/ExtendedUnityPlayerActivity.java",
    "chars": 5725,
    "preview": "// UnityPlayerActivity and WebView integration\n\npackage jp.radiumsoftware.unitywebviewexample;\n\nimport com.unity3d.playe"
  },
  {
    "path": "unity/Assets/GUI/Default GUI SKin.guiskin.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: ecaca87ebef4e4961ab66cf142175f61\n"
  },
  {
    "path": "unity/Assets/GUI/SU3DJPFont/Fonts/s1-mplus-1c-light.ttf.meta",
    "chars": 216,
    "preview": "fileFormatVersion: 1\nguid: 596c1fd1351a65540b8f6baeb5c83ccb\nTrueTypeFontImporter:\n  importerVersion: 1\n  size: 16\n  case"
  },
  {
    "path": "unity/Assets/GUI/SU3DJPFont/Fonts.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 9e26e0c931f64c44799647ea7fd00b96\n"
  },
  {
    "path": "unity/Assets/GUI/SU3DJPFont/license.txt",
    "chars": 342,
    "preview": "LICENSE\r\n\r\nThese fonts are free softwares. \r\nUnlimited permission is granted to use, copy, and distribute it, with or w"
  },
  {
    "path": "unity/Assets/GUI/SU3DJPFont/license.txt.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 876dd09a256784345be2d6045b6571a3\n"
  },
  {
    "path": "unity/Assets/GUI/SU3DJPFont/readme.txt",
    "chars": 1678,
    "preview": "\r\nSelected U3D Japanese Fonts   05/17/2011\r\n\r\n------------------------------------------------------------------------\r"
  },
  {
    "path": "unity/Assets/GUI/SU3DJPFont/readme.txt.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 4a4f1ada9e7459344bc4acb002b22a4b\n"
  },
  {
    "path": "unity/Assets/GUI/SU3DJPFont.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 2c7ff880dcb39c14199433ad6846d37b\n"
  },
  {
    "path": "unity/Assets/GUI.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 3a3b1c6f5244d498e95e41026452dc53\n"
  },
  {
    "path": "unity/Assets/Main.unity.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 5dd8fad3f211b4f50aaee8743a63da4e\n"
  },
  {
    "path": "unity/Assets/Materials/Blue Box.mat.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 905886db109bd4a36af150540c0bd0f1\n"
  },
  {
    "path": "unity/Assets/Materials/Floor.mat.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: e06bb986f1a7e4dc6841f7cb59aeef8e\n"
  },
  {
    "path": "unity/Assets/Materials/Red Box.mat.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: ac8ade9aa523842fab3b893be999d08e\n"
  },
  {
    "path": "unity/Assets/Materials.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: eacdd09aa755f4bf6b6531b7af53dad5\n"
  },
  {
    "path": "unity/Assets/Physics/Default Physic Material.physicMaterial.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: daef168d6938746eda86db30cd78df40\n"
  },
  {
    "path": "unity/Assets/Physics.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 046d56fdea7e34d05bbe1082f55a769d\n"
  },
  {
    "path": "unity/Assets/Plugins/Android/AndroidManifest.xml",
    "chars": 1143,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    pack"
  },
  {
    "path": "unity/Assets/Plugins/Android/AndroidManifest.xml.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 50bf13cedd20a49f3b2ef3e88cf13d4f\n"
  },
  {
    "path": "unity/Assets/Plugins/Android/WebViewIntegration.jar.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 94d9591b24ce3471383b7b7f121cb653\n"
  },
  {
    "path": "unity/Assets/Plugins/Android.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 22aac9bb108084be8b2ffc5ec762342e\n"
  },
  {
    "path": "unity/Assets/Plugins/WebMediator.js",
    "chars": 5192,
    "preview": "#pragma strict\n\n// WebView-Unity mediator plugin script.\n\nimport System.Runtime.InteropServices;\n\n// Message container c"
  },
  {
    "path": "unity/Assets/Plugins/WebMediator.js.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 9b61fa8dd1f9f40d9a0788beb93cd400\n"
  },
  {
    "path": "unity/Assets/Plugins/iOS/WebViewPlugin.mm",
    "chars": 2627,
    "preview": "// Web view integration plug-in for Unity iOS.\n\n#import <Foundation/Foundation.h>\n\nextern UIViewController *UnityGetGLVi"
  },
  {
    "path": "unity/Assets/Plugins/iOS/WebViewPlugin.mm.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 2\nguid: 4fd761aa32d674f48b76101ac5cf8971\n"
  },
  {
    "path": "unity/Assets/Plugins/iOS.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 2\nguid: 9bde65d35751a4fa88830f764562c2bb\n"
  },
  {
    "path": "unity/Assets/Plugins.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 04a4b0667591a44f6a9cc634795749cf\n"
  },
  {
    "path": "unity/Assets/Prefabs/Blue Box.prefab.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: c1a1ab85a23cd4ce1bdd3731ac0ab9dd\n"
  },
  {
    "path": "unity/Assets/Prefabs/Red Box.prefab.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 74768062b89004afb801f11a7a523ca1\n"
  },
  {
    "path": "unity/Assets/Prefabs.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 9eb3019c10b364779925ef1ec161fb47\n"
  },
  {
    "path": "unity/Assets/Scripts/Box.js",
    "chars": 96,
    "preview": "#pragma strict\n\nfunction Update() {\n    if (transform.position.y < -2.0) Destroy(gameObject);\n}\n"
  },
  {
    "path": "unity/Assets/Scripts/Box.js.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 5f957e7e7cda347e0bbfaf9c31ec781d\n"
  },
  {
    "path": "unity/Assets/Scripts/TestInterface.js",
    "chars": 2523,
    "preview": "#pragma strict\n\nvar guiSkin : GUISkin;\nvar redBoxPrefab : GameObject;\nvar blueBoxPrefab : GameObject;\n\nprivate var note "
  },
  {
    "path": "unity/Assets/Scripts/TestInterface.js.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: de41a1264b5be41c48fa4a0b821508b2\n"
  },
  {
    "path": "unity/Assets/Scripts.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 6f9ab5fa22bd84d038705e7f6d302a8f\n"
  },
  {
    "path": "unity/Assets/Textures/Board.png.meta",
    "chars": 501,
    "preview": "fileFormatVersion: 1\nguid: b9953bd5259dc48cc95acccd0f8c1228\nTextureImporter:\n  importerVersion: 1\n  maxTextureSize: 1024"
  },
  {
    "path": "unity/Assets/Textures/Checker2.png.meta",
    "chars": 603,
    "preview": "fileFormatVersion: 1\nguid: a94bba682ebe648c08416aff1b18ad2e\nTextureImporter:\n  importerVersion: 2\n  maxTextureSize: 1024"
  },
  {
    "path": "unity/Assets/Textures.meta",
    "chars": 60,
    "preview": "fileFormatVersion: 1\nguid: 28e2e9674dd404ef6ab51022aef57fc0\n"
  }
]

// ... and 21 more files (download for full content)

About this extraction

This page contains the full source code of the keijiro/unity-webview-integration GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 68 files (29.2 KB), approximately 9.3k tokens, and a symbol index with 47 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!