gree / unity-webview

zlib License
2.26k stars 689 forks source link

Can i use it with google cardboard and also with pointer controller? #612

Open bdmg06114 opened 3 years ago

bdmg06114 commented 3 years ago

Hi, I'm a middle school student and I wanna use this for a VR cinema project. but due to my budget i gotta make it with google cardboard so there's a few questions.

  1. Can I use it as texture? so that i can project it to mesh. cause i want it to be customizable screen.
  2. will it affect performance? cause i don't think i have a great phone.
  3. How can i interect with webview object like raycast? hope you reply soon:) and Thank you for let us use this amazing code free
KojiNakamaru commented 3 years ago

This plugin places a native WebView over the unity's rendering view and doesn't allow to place the webview in 3D space, so it is not adequate for VR. Related discussions can be found in several issues. The following comments include some useful links (but they might not be directly utilized).

https://github.com/gree/unity-webview/issues/81#issuecomment-444887211 https://github.com/gree/unity-webview/issues/81#issuecomment-445650131

You can also find assets on Asset Store (although they might be a bit expensive), for example,

https://assetstore.unity.com/packages/tools/gui/3d-webview-for-android-web-browser-137030 https://assetstore.unity.com/packages/tools/gui/3d-webview-for-android-and-ios-web-browser-135383

DineshGro commented 10 months ago

How do add this in WebGl project?

KojiNakamaru commented 10 months ago

How do add this in WebGl project?

WebGL is not directly related to this issue. What are you talking about?

HafizMSaad commented 6 months ago

@KojiNakamaru so it is not adequate for VR I have a query regarding the above context: What if I need to run it on a 2D app running on a VR headset? And would it be fullscreen, I mean immersive?

KojiNakamaru commented 6 months ago

@HafizMSaad I've not tried to test this plugin for VR headsets, and I guess it heavily depends on each VR headset. For example, a VR headset based on an ordinal smartphone utilizes the smartphone's single screen to display two images for left/right eyes. This plugin however shows a single WebView on the screen so it won't appear correctly for left/right eyes. In order to support various VR headsets correctly, rendering webviews in 3D seems to be required even if you render only 2D games.

HafizMSaad commented 6 months ago

@KojiNakamaru Thank you for the prompt response, it's greatly appreciated. Just one more question: Is it possible to inject JavaScript into it while running on Android?

KojiNakamaru commented 6 months ago

@HafizMSaad Yes, you can utilize EvaluateJS(), for example:

    webViewObject.EvaluateJS("document.body.style.backgroundColor = 'red'");
HafizMSaad commented 6 months ago

For those seeking VR-compatible solutions, I recommend checking out the following repository: https://github.com/TLabAltoh/TLabWebViewVR

Rajdeep-git776 commented 4 days ago

How can i add the webview in a 3D space. Any solution for this? i dont want to buy any paid plugins

HafizMSaad commented 4 days ago

https://github.com/TLabAltoh/TLabWebViewVR

@Rajdeep-git776

Rajdeep-git776 commented 4 days ago

@HafizMSaad can i use this for Android devices?

HafizMSaad commented 4 days ago

@HafizMSaad can i use this for Android devices?

@Rajdeep-git776 I used it for my HMD(Android-Based), and it worked!