GithubHelp home page GithubHelp logo

puerts_unity_webgl_demo's Introduction

Puerts WebGL demo

本项目包括了一个可以以WebGL模式构建运行Puerts的Unity项目。puerts的JS代码会运行在浏览器JS引擎里,而不是运行在编译为WASM的JS解释器里。

You can build a unity puerts project in webgl mode now. Your Javascript code will run in browser Javascript engine instead of a interpreter in WASM.

Progress

  • unity 2019支持 ✔
  • unity 2020支持 ×
  • 简单旋转demoAssets/Scenes/SampleScene
  • 篮球小游戏demoAssets/Scenes/BasketballDemo

Dependent

因为大量使用到了WeakRefFinalizationRegistryAPI。该功能在以下环境下可用:

This feature will deeply depend the WeakRef and FinalizationRegistry API. Which are supported in below environment:

  1. V8 8.4+ (eg. Chrome 84+)
  2. iOS Safari 14.5+/OSX Safari 14.1+

How to contrib

  • 运作原理(how this work?)

Puerts的WebGL版本是利用Unity官方提供的Unity代码与浏览器脚本交互的功能,对Puerts中使用到的PuertsDLL.cs里的API通过JS一一进行实现。关键代码位于Assets/Plugins/puerts.jslib

With this Manual which provided by Unity. We implements a jslib located at Assets/Plugins/puerts.jslib. It should provide the API in PuertsDLL.cs which support Puerts to run.

  • 未来还有以下工作要做(TODO):
  1. 在jslib实现剩余的PuertsDLL.cs的API
  2. 支持2020 2021

puerts_unity_webgl_demo's People

Contributors

zombieyang avatar

Watchers

 avatar

Forkers

tomdyqin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.