Open SoleR7 opened 5 years ago
The sample app defines buttons (by Legacy GUI system) simply as an example. You can remove them. The plugin however places webviews over Unity's rendering view so that you cannot place, for example, a uGUI button over webviews.
webViewObject.enabled = false;
If you call webViewObject.SetVisibility(false)
you should be able to click the button.
As you said, setting the visibility to false works, but the buttons are still not clickable, like in the screenshot I have attach in the post the buttons remain a "layer" behind the GUI buttons.
I have also tried to remove all the GUI elemets deleting the onGUI()
method but with no result, the canvas buttons cannot be clicked.
I don't know what it is but there must be something that it is "above" the canvas that prevents the clicks even when the webView is not visible.
By the way, I have just read your response to this issue and seems like a good workaround, but how do I know where I have to tap to get back the focus to the canvas? I have tried to put the buttons outside the webview (playing with webview margins) but still nothing.
Thanks :)
I've modified the sample app so that
*
button toggles the visibility of the webviewYour modification works, thats what I wanted! Still a pity that I can not place UI elements above the webview so, I will have to change my original desing but that's not a big deal. In addition to that I have discovered why It didnt work for me previously, I deleted the EventSystem object because I though it wasnt important but without it the clicks are not possible.
Thanks for everything! :)
Hi @KojiNakamaru sorry for the bump. But is there any way i can place elements on top of the webview? Currently designing around it, like creating a frame or border to hold the webview and my UI elements outside?
But if i can place it on top, that would be amazing. Any workarounds to do this?
Unfortunately, no, as this plugin overlays native webview views over unity's rendering view. There is an experimental implementation that works with "render over ui" #584 but it cannot allow any user interaction with webview views. You can find other implementations on Asset Store https://github.com/gree/unity-webview/issues/612#issuecomment-724541385 .
Hello @KojiNakamaru and everyone, I would like to know if is still not possible to work with a canvas with buttons or whatever in the same scene as where the WebView is.
Here you can see that I have move the margins and WebView Buttons, but behind the first one I have a buton from a canvas, which is not possible to click.
In the next screenshot I have tried to "hide" the WebView in the second button with
webViewObject.enabled = false;
but doesnt respond. With the first button (the one withDestroy();
) It hides but I'm still not able to click any of the buttons.So there's any solution or workaround for this, any way of use canvas elements? Do I will have to work with GUI buttons only? Thanks :)