Huy Minh Ha

Software development, Tech and other stuff

Mon 08 January 2018

Webview with schema

Posted by Ha.Minh in Unity   

The unity-webview plugin is nice, but one thing is you have to call Unity.call from Javascript. This is not very convenient for those who design the HTML to quickly assign action related to Unity in hyperlinks.

So I added support for calling Unity function using normal links in HTML using the schema unity://. For example, we can put the link: unity://scene?param1=value1&param2=value2. When clicking this link, the string scene?param1=value1&param2=value2 will be passed to Unity, then we can use WebViewHelper to parse it furthur into scene, param, value1, param2, value2 and so on.


    
 
 

Comments