Open Volko76 opened 5 days ago
I tested on the master branch and I get the same results : it is working in the editor but not on android
Transparency doesn't mean that events can be passed to unity. Every event on the webview rectangular region is treated by the webview. The experimental/unity-over-native-ui variant is for drawing unity's elements over webviews. For that variant, you need to specify masks to receive events in unity (cf. https://github.com/gree/unity-webview/pull/584#issuecomment-1761410366 ).
If you utilize the latest one on the master branch, you can receive an event on webview and send it to the unity side by Unity.call().
Thanks a lot for the anwser @KojiNakamaru , it clarifies a lot of things.
However, I don't fuly understand how masks are working I think. Can you explain a little bit more how mask are working ?
I forked the experimental branch, enable Render Over UI and 32Bit in the android player settings. Then I allowed cleartext to use my local http server for debug. I set the margins to 0, 0, 0, 0 and the mask to 0, 0, Screen.width, Screen.height to fill the whole screen but I still cannot register a click on a TMP Button.
Am I doing something wrong ?
Thanks a lot
I put a modified sample app under https://github.com/gree/unity-webview/tree/example-for-1115/sample where modification commits are below:
https://github.com/gree/unity-webview/compare/4426a65...d8b69d6
In this sample, margins (0, 0, 0, 0)
and a mask (0, 0, Screen.width, 100)
are specified.
We can press top buttons rendered by unity while interacticting the webview in other regions.
Thanks a lot for the provided sample app. Unfortunatly, I don't manage to make this sample app to work 😥
This is really strange. I clone this branch, open it up in Unity (6000.0.26f1), opened the sample scene, select android, select developpement build, click on "build and run".
And I can interract with the webview but not with the top buttons.
I'm using a rog phone 6 on android 14. It has 12 Go of ram and a Snapdragon 8+ Gen 1
Okay, so I made my experiments and it turns out that in 6000 and in 2022, it does not work but in 2020 it's working. I will try to investigate on why
2021 does not work too
I tested with 2020.3.48f1 like you, but also with 2020.3.47f1 to see if it was the "reimport" process of Unity that causes issues but they both work.
So the issue surely comes from the changes between 2020 and 2021
I tried with iOS and it worked on all versions but not on android
Thanks for testing various unity versions. I investigated what happened and found the following part "bringToBack" logic didn't work for recent unity versions.
This issue seems unavoidable, so I tweaked event handling logic:
https://github.com/gree/unity-webview/compare/d8b69d6...083dc00
The sample app on the latest https://github.com/gree/unity-webview/tree/example-for-1115 should work correctly. Please note that you need to import the package from this branch as I updated plugin code and binaries only on this branch.
Thanks a lot, I will try it out
Hi, I'm trying to make an AR mobile app. The interface is in HTML and is served by a server. It communicates via Unity via EvaluateJS.
I would like to be able to click on the red area to place object in the floor (using a raycast).
The red area is transparent (I set the webview to transparent too) and I see the Unity world here. The issue is that when I click in the red area, my click is not registered by Unity (in android) so it doen't trigger the placement of the object at this position.
I tried to use https://github.com/gree/unity-webview/tree/experimental/unity-over-native-ui and it seems to work in the editor but not in android. I also tried with 32Bit and RendeOverNativeUi enabled and disabled and it changed nothing. I know it is in experimental.
Am I missing something ?
Thanks a lot for the project and the help provided Wishing you the best day