About how Unity Programs Display embedded web pages on IOS and Android, unityandroid

Source: Internet
Author: User

About how Unity Programs Display embedded web pages on IOS and Android, unityandroid

Recently, embedded web pages are displayed on ios or android mobile phones because of the need to run the program in Unity. So I collected relevant information from the Internet. As follows:

UnityWebCore first saw this in the search. After downloading it, it seems that this principle is achieved by calling the browser kernel and rendering the web page to the mesh. Unfortunately, only the windows desktop version is supported. But we can download it if necessary. :Http://pan.baidu.com/s/1nt3FVkd


Unity-webview

This is found on github. It is written by keijiro's Japanese.

Https://github.com/keijiro/unity-webview-integration

It is to call the corresponding WebView component display on the mobile phone platform, for example, UIWebView is called on IOS. At the same time, you have defined the interaction format with javascript. You can call javascript in the c # code of unity. If you need it, try it. You can see the effect on ios and android.

Based on the projects compiled by keijiro, you can also find the projects modified after fork by others on github. Some packages and modifications should be made, but they are all based on keijiro.

Https://github.com/Kogarasi/Unity-Webview

Https://github.com/gree/unity-webview


UniWebView

This is a Chinese component. It is also displayed by calling the corresponding WebView component on the mobile phone platform, and supports interaction with javascript. However, the project is perfect. You can see the running effect on mac OS and mobile phone systems, and the results are very good. It is recommended, but I cannot provide it when I regret it. Because this plug-in is charged. To support the author, please purchase it by yourself.


How does Unity call Native APIs in Android and iOS?

First, unity supports Calling C ++ dll in C #, so that C ++ interfaces can be provided in Android and iOS to be called in unity. With this feature, you can extend the functions of unity. For example, integrate and call third-party libraries. To ensure consistency of the unity interface, you can provide the same interface on android and iOS for C # to call. The following two examples are provided. The interface declaration for this example is as follows: public class CallNativeAPI {# if UNITY_EDITOR public static void OpenWebView (string url) {return;} public static void SumNum (int v1, int v2) {TestUnityEditor. sumNum (v1, v2); return ;}# elif UNITY_IPHONE [DllImport ("_ Internal")] public static extern void OpenWebView (string url ); [DllImport ("_ Internal")] public static extern void SumNum (int v1, int v2); # elif UNITY_ANDROID [DllImport ("libtestunity", CallingConvention = CallingConvention. cdecl)] public static extern void OpenWebView (string url); [DllImport ("libtestunity", CallingConvention = CallingConvention. cdecl)] public static extern void SumNum (int v1, int v2); # endif public static void SumNumForResult (int v1, int v2, CallbackManager. resultCallback callback) {TestCallbackManager. sumNumCallback. setResultCallBack (new CallbackManager. resultCallback (callback); SumNum (v1, v2); return ;}} namespace CallbackManager {public delegate void ResultCallback (int result); public class SumNumManager {public SumNumManager () {} private ResultCallback resultCallback; public void SetResultCallBack (ResultCallback callback) {resultCallback = callback;} public void SendResult (int result) {resultCallback (result );}}} public class TestCallbackManager {public static CallbackManager. sumNumManager sumNumCallback = new CallbackManager ....... remaining full text>

How do I call the external camera (including the front camera and the rear camera) of the iphone or ipad when developing ios programs using Unity3D )?

Unity3D generates the entire ios project. Of course you can modify it. How can I modify it? Open it with xcode, and then develop the iphone.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.