Hello, dear.

Tell me how to implement simple HTML browser in Unity? Preferably by means of C #.

The browser should render a page from a string with html-code (for example, a dialogue with the NPC). Downloading from the network is not required.

I looked in the Internet, but I didn’t find anything useful, but in some games on Unity, the simplest browser is present.

Thank!



    2 answers 2

    1. Awesomium ( http://www.awesomium.com/). Starting from version 1.7, the web texture is not displayed in the Editor, debugging is very difficult, only logging, and you will not go far on the logs. Earlier versions work fine, but for a number of other reasons, earlier versions do not work.

    2. uWebKit ( http://uwebkit.com/). This animal is quite easy to integrate into the project, but there is one thing, but when watching a video, it almost dies out, the video is displayed about 5 frames per second. Rip out the eye, in short. He also refuses to work YouTube Api (JavaScript), and this is specific.

    3. Coherent UI ( http://coherent-labs.com/) Perhaps the best candidate, works smartly, is friends with YouTube Api, but does not know how to open links that should open in a new window. (We enter a request on google.ru, we try to click on the result, and the effect is a bolt)

    Here's more info on Habré: http://habrahabr.ru/post/220183/ and this is an example of controlling the browser from the embedded scripts in the unit: For example, send JavaScript to your browser: http://docs.unity3d.com/ScriptReference/Application .ExternalCall.html

    And this, for example, to return the page back with a standard button in the unit: http://docs.unity3d.com/ScriptReference/Application.ExternalEval.html

      We used a relatively new plugin Embedded Browser in our project - which integrates Chromium based Unity 3D browser into Unity 3D and allows you to overlay the page on any mesh surface, including using it in the UI . You can play videos from Youtube , download pages from the built-in local server. It is better to see once, download the demo and see all the rich features of the plugin. True, there is also a fly in the ointment, in some projects, when debugging with the presence of a browser, Unity was hanging.

      • Looks cool, thanks! How does he deal with performance and modern html5 / css3, does flex box support? There is an idea to use html with a simple layout as dialogs with unwritten text. - Yevgeny Karpov
      • Productivity does not sink. We used in the project up to 20 windows simultaneously with html and brake video clips were no more than when launching the same windows in the browser. For the rest I will not say, we did not dive so deeply with him - KingPeas