GithubHelp home page GithubHelp logo

keithleung / unity-webview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gree/unity-webview

0.0 1.0 0.0 631 KB

License: zlib License

HTML 8.15% JavaScript 7.31% C# 28.02% Ruby 5.58% Shell 2.00% Java 14.26% Objective-C 22.68% Objective-C++ 12.00%

unity-webview's Introduction

Introduction

unity-webview is a plugin for Unity that attaches WebView component in the game scene. It works on Android, iOS, OS X, and WebPlayer.

unity-webview is derived from keijiro-san's unity-webview-integration https://github.com/keijiro/unity-webview-integration .

Caution

** This plugin doesn't support Unity 3.*. ** But you can be able to run in Unity 3, if modified WebPlayerTemplates/unity-webview/index.html.

How to use

(TBW)

Document

(TBW)

For iOS

CADisplayLink stops updating when UIWebView scrolled, thus you have to change AppController.mm as the following.

-        [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+        [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];

For Web Player

Since using IFRAME, some problems can be occurred because of browsers' XSS prevention. It is desired that "an_unityplayer_page.html…" and "a_page_loaded_in_webview.html…" are located at same domain.

Android: Uncaught TypeError: Object [object Object] has no method 'call'

gree#10

Sample Project

$ open sample/Assets/Sample.unity
$ open dist/unity-webview.unitypackage
Import all files

Notes on Adnroid

Once you built an apk, please copy sample/Temp/StatingArea/AndroidManifest-main.xml to sample/Assets/Plugins/AndroidManifest.xml, edit the latter to add android:hardwareAccelerated="true" to <activity android:name="com.unity3d.player.UnityPlayerActivity" ..., and rebuilt the apk. Although some old/buggy devices may not work well with android:hardwareAccelerated="true", the webview runs very smoothly with this setting.

unity-webview's People

Contributors

kojinakamaru avatar splhack avatar n-yoda avatar jake1256 avatar imkira avatar appirits-nakamatsu avatar hiroyuki0115 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.