uwu-0.1.0.zip

  • vectorer
    了解作者
  • WINDOWS
    开发工具
  • 21KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2021-03-18 13:15
    上传日期
Web view inside unity.supports various platform
uwu-0.1.0.zip
  • uwu-0.1.0
  • COPYING
    33.7KB
  • README.md
    2.4KB
  • Ultralight.cs
    17.2KB
  • ulbridge.cc
    20.2KB
内容介绍
# Ultralight with Unity UwU is a bridge between Ultralight and Unity allowing you to use interfaces made in html within Unity. It supports loading urls and files, mouse and (basic) keyboard interaction, executing javascript in the loaded page, and calling C# functions from javascript (asynchronously). # Installing Download an ultralight SDK from their download page. Then download the UwU native component from the releases tab, or build your own dll/so. All the dll/so from ultralight must be copied to the Unity editor binary dir, as well as the UwU dll/so. That UwU native component *must* be called `ulbridge.so` on all platforms. Finally copy the ultralight.cs file in your Assets/scripts directory. # Using Instantiate an ultralight script component on any GameObject. If the "Is Gui" inspector setting is true, it will render as a GUI on screen. Otherwise it will render using the `Sprite renderer` attached to the same game object. You can set the url to an `http` or `https` url to hit online resources, or use a `file` url to get a local filesystem resource (the root is the current working directory for now). ## Javascript Execute Javascript by calling `ExecJavascript`. Note that due to the asynchronous nature of the binding this cannot return the result of the evaluation. To call C# code from Javascript, register a function with `UltralightManager.Instance().RegisterCallback("myFunctionName", callback);`, and invoke it in javascript by doing `window.nativeCall("myFunctionName", "payload");`. Payload must be a string. # FAQ ### How to get a transparent background? Don't set a background color. Instead use a div that covers the whole page with an alpha component in it's color (`color = #ffffff70` for instance). ### It crashes, what should I do! Ensure you do not call any of the synchronous functions within your code. Also ensure that you don't make any call on a view *before* it is created. # Design rationale. The UwU native component runs in its own native thread that persists between successive runs in the editor. What will *not* work: - Running UwU in the main thread: the graphics commands Ultralight uses conflict with unity. - Running UwU in a C# thread: the thread will be killed when you exit play mode, and recreating a new one on next play will crash Ultralight. - Having a C# callback on UwU thread each frame. Fails because the C# runtime then registers the thread, which prevents Unity from unloading the AppDomain when you exit play mode.
评论
    相关推荐
    • Unity3d适配
      Unity3d 实现屏幕自动适配,里面有一个完整的小Dmeo可以学习下。
    • unity3D漫游
      这是一个简单的游戏场景漫游效果,模型在3DMAX中设计导出成FBX格式后在unity3D中作开发
    • unity3d斗地主
      unity3d斗地主,保证可以直接用unity3d编译,有代码+祥细说明
    • Unity3d
      Unity贪吃蛇Unity贪吃蛇Unity贪吃蛇Unity贪吃蛇
    • unity 3D虚拟漫游
      仅供大家学习交流,一个学校的场景漫游·
    • unity 3d FingerGestures插件
      FingerGestures方便检测各种输入手势,比如轻敲、拖拽、扫过、长按、捏、或拧等。
    • unity 3d游戏源文件
      unity 3d游戏源文件 飞机闯关游戏
    • Unity 3D脚本编程
      Unity 3D脚本编程,适合初级开发者,不错的入门书籍~~~
    • unity 3D补丁工具
      unity 3D 3.5.6补丁工具,该补丁系网上收集,请谨慎使用
    • Unity 3D跑酷游戏
      Unity 3D跑酷游戏游代码,资源齐全,亲自编译可运行,仅供学习之用