Unity integration utilities for OneJS (v0.2.13), providing asset loading, esbuild/PostCSS build plugins for USS transformation, and GPU compute APIs. Designed for Unity developers using OneJS to write UI and logic in JavaScript/TypeScript. Key differentiators: automatic path resolution between Editor and Build modes, npm package asset distribution without config, built-in Tailwind-like utility class generation for USS without external tailwindcss dependency, and ES6 import transformation for C# namespaces. Requires react ^18/^19, esbuild >=0.17, postcss >=8, tailwindcss >=3. Ships TypeScript types.
npm install onejs-unityNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates asset loading and esbuild plugin setup for USS transformation with TypeScript.
You can install tailwindcss as a peer dep to satisfy the requirement, but it is not strictly needed for the USS generation.
Use assetExists() to check availability before loading, or wrap calls in try-catch blocks.
Ensure module names start with an uppercase letter (e.g., 'UnityEngine', not 'unityEngine').
Upgrade Node or use a bundler that supports package.json exports.
Ensure your bundler (esbuild, webpack, etc.) supports subpath exports. For Node scripts, use Node >=16. Alternatively, import from the main package if the subpath is not required.
Use: import { loadImage } from 'onejs-unity/assets';Provide content glob array: tailwindPlugin({ content: ['./src/**/*.{tsx,ts}'] })