Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(196评价)
价格: 4049.00元
unity 内嵌网页插件 3D WebView for Windows and macOS 怎么能让网页背景从白色变成透明啊
四世界之想发起了话题2023-04-19
1
回复
171
浏览

我看他文档中的方法

await webViewPrefab.WaitUntilInitialized();

// Disable the default white background so the page can be transparent. webViewPrefab.WebView.SetDefaultBackgroundEnabled(false);

使用的时候没有 SetDefaultBackgroundEnabled这个函数

 

所有回复
  • 老师_Trigger 2023-04-19

    如果在使用3D WebView插件的过程中,没有找到SetDefaultBackgroundEnabled函数,可能是因为这个函数在该插件的早期版本中存在,但现在已经被删除或更改了。

    您可以尝试使用以下代码,将网页背景设置为透明:

    await webViewPrefab.WaitUntilInitialized();
    
    // Set the background color of the web view to transparent.
    webViewPrefab.WebView.SetBackgroundColor(Color.clear);

    这样应该就能将网页的背景颜色设置为透明了。需要注意的是,使用这种方法可能会影响到网页中的其他元素,在透明背景上的元素可能会出现模糊或反锯齿的效果。

    还有-5条回复,点击查看
    你还没有登录,请先登录注册
发表回复
你还没有登录,请先 登录或 注册!