"Working Dir Rework" has landed in the private repo (also submitted to the Asset Store). You are now able to keep all your scripts under `{ProjectDir}/OneJS`. And the scripts will be automatically bundled into`{persistentDataPath}/OneJS` for Standalone builds. Docs here have been updated accordingly.

New features and bug fixes will land in the private github repo before becoming available on the Asset Store. To request access, please send an email or pm Singtaa#4915 on Discord with your Github username and OneJS Order/INV number.

This sample is available as a public repo at https://github.com/DragonGround/OverwatchSample

Step-by-step Setup

  • Extract this repo to {ProjectDir}/OneJS/ForniteSample
  • Under {ProjectDir}/OneJS, make a index.tsx file like below:
import { render, h } from "preact"
import Overwatch from "OverwatchSample"
import { update } from "tweenjs/tween"

render(<Overwatch />, document.body)

function animate(time) {
  • Open {ProjectDir}/OneJS with VSCode and run the tsc: watch task (Ctrl + Shift + B)
  • In Unity, drag a ScriptEngine prefab onto the scene.
  • Import the included CharacterManager.cs file into Unity and drag the MonoBehaviour onto a scene.
  • Then include CharacterManager into the Objects list under ScriptEngine's INTEROP; name it to charman
  • Make sure Live Reload's entry script is set to index.js.
  • Hit Play and you should be all set

Everytime you checkout a new OneJS version (from the private repo or Asset Store), make sure you also update your ScriptLib folder. You can do so by deleting the old one, a new one will be automatically created upon running ScriptEngine. This step will be automated in the future.