-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raycasting on Unity Button through Webview [Android] #1116
Comments
Hi @SadevK95 , So for method 2, you just need in your webpge to create a html button that calls the js function Unity.call(something) where "something" is a string that will be passed to Unity in the SampleWebView.cs script under webViewObject.Init(cb: (msg)). So here is an idea of the code : In you webpage : In you SampleWebView.cs in unity : |
Hi @Volko76, Thanks a lot for prompt response. Can you bit elaborate on how to webpage html button code must be construct. Thanks a lot. |
You can find a concrete example in the sample app. The sample app invokes
which in turn invokes the unity-webview/sample/Assets/Scripts/SampleWebView.cs Lines 40 to 46 in 3aa60f0
|
Oh i provided the button example but it seems that Github has deleted it from my comment due to cybersecurity reasons. I meant : But @KojiNakamaru provided also a sample project, you can take a look at it. |
@Volko76 Thanks a lot. It works now. :) |
@SadevK95 You're welcome ^^, I'm glad you managed to do it |
Hi. I'm using this webview for load Web based Video Call application. I just want to navigate different Unity scene when the user click on hang-up button on webpage.
My workaround on achieving this is place a unity UI button under the the web hangup button and click it. Can you kindly assist me to achieve this.
Or is there any way to communicate webpage to Unity like trigger an Unity event by listing on the webpage clicks.
The text was updated successfully, but these errors were encountered: