
OneJS brings JavaScript and many beloved web techs to Unity, seamlessly integrating with UI Toolkit without the need for a browser or webview.OneJS provides scripting capabilities. You can use whichever SRP with it.Visit onejs.com for Documentation and TutorialsDiscord • Youtube • Twitter/X • GithubOneJS lets you use JavaScript in Unity, for both runtime and editor. It focuses on UI scripting but works for anything you’d usually handle with JS.Why use OneJSLightning-fast iteration: Change your UI code and see results instantly. No more domain reloads.Familiar tooling: Use TypeScript, (P)React, Tailwind and other web techs you already know and love.Broaden the talent pool: Studios can tap into web devs for UI work.Unity-native: Works directly with UI Toolkit - no browser, no overhead.Desktop and Mobile: Tested on Windows, Mac, iOS, and Android.Powerful scripting: Give your players the ability to mod your game with TypeScript and JSX.The base OneJS code is open source. Purchasing it through the Asset Store grants you access to our growing library of high-quality, ready-to-use Game UI components, designed to save you tons of dev time.(Familiarity with React and Typescript is recommended)OneJS integrates directly with Unity’s UI Toolkit , a shader-based, retained-mode UI system inspired by web tech. UI Toolkit already offers web concepts like DOM and CSS, and OneJS complements it by having a JavaScript backend (QuickJS, V8, or NodeJS via Puerts ) and turbo-charges your UI workflow using familiar toolings like TypeScript, Preact, Tailwind, and ESBuild.Requirements- Unity.Mathematics- Unity.Burst- Unity Version 2021.3+ (for stable UI Toolkit)- Unity Version 2022.1+ (if you need to use UI Toolkit's Vector API)PlatformsSupported on Windows, Mac, iOS, and Android(Tested on Ubuntu by community members as well)
OneJS は、Unity 向けに特別に設計されたスクリプト エンジンおよび UI ソリューションです。 軽量でパフォーマンスが高く、純粋な C# ベースであり、第一級の Typescript サポートを備えており、どこでも動作します。
説明
ウェブサイトとドキュメント • Discord • Youtube • Twitter • フォーラムのスレッド
(React と Typescript に精通していることが推奨されます)
OneJS の最大の利点は、React (JSX) ワークフローを使用して UI を設計できることです。 これは、Preact に薄い層の「dom」を提供することで実現します。 内部的には純粋な UIElements なので、非常にパフォーマンスが高くなります。 UI Toolkit のコントロール、イベント、ベクター API、スタイルはすべて、そのまま使用できます。
OneJS を使用すると、UI コードを変更するたびに C# スクリプトをコンパイルする必要がなくなります。 特に組み込みのライブ リロードを使用すると、反復時間が非常に速くなります。
UI に加えて、OneJS を使用してプレーヤー用のアドオン システムを簡単に構築することもできるため、Typescript + JSX + CSS の力を利用してゲームのアドオン/MOD/コンテンツを作成することもできます。
技術的な詳細
要件
- Unity.数学
- Unity バージョン 2021.3+ (安定した UI ツールキット用)
- Unity バージョン 2022.1+ (UI Toolkit の Vector API を使用する必要がある場合)
機能のハイライト
- Unity での UI 開発のための Typescript と JSX
- ライブ リロードによる高速イテレーション速度 (複数のデバイス間でも)
- Preact と UI Toolkit 間の 1 対 1 の相互運用による素晴らしいパフォーマンス
- スタイル付きコンポーネントと感情 API が組み込まれています
- ランタイム CSS ランタイム時に CSS 文字列を動的にロードします。
- Tailwind ユーティリティ クラス、任意の値、および応答ブレークポイントがサポートされています。
- 非同期/待機およびC#タスクがサポートされています
- Preact Signals はすぐに使用できます
- 大量の UnityEngine および UIElements タイプの TS 定義。 また、入力作業をより簡単にする C# から TS への型コンバーターも提供しています。
- どこでも動作 (Mac、Windows、iOS、Android、エディター、スタンドアロン、Mono、Il2cpp)
- 必要なときに内蔵のセキュリティ。 (プレイヤーにスクリプト機能を提供することを選択した場合は、Jint の好意により、メモリ制限、呼び出しの深さ、スクリプトのタイムアウトなど、多くのセキュリティ設定を設定できます)
C# ソース コードに完全にアクセスできるようになります。 ライブラリ Javascript ファイル (Preact や Lodash など) は縮小されます。 プライベート Github リポジトリへのアクセスは、Discord 経由でリクエストすることもできます。