Skip to content

About

An Angular CLI sample for Needle Engine with Unity

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Needle Engine with Angular

An Angular CLI sample for a Unity-exported Needle Engine scene. It uses Unity code generation in src/generated/gen.js and serves the exported scene from public/assets.

Run locally

Install the dependencies after @needle-tools/engine@6.0.0-alpha.5 is available on npm:

npm install
npm start

Open https://localhost:3000/ and accept the local development certificate. The server also listens on the local network for device testing.

Build

npm run build:dev
npm run build:production

Both commands refresh public/needle-license.json. The production command runs Angular's production build, then invokes the glTF build pipeline with npx on dist/needle-engine-angular/browser/assets. Unity provides the pipeline version through NEEDLE_BUILD_PIPELINE_VERSION; manual builds use the version in devDependencies. The pipeline writes optimized assets to that same output folder. With a Basic license, this optional step is skipped.

Set NEEDLE_CLOUD_TOKEN in CI for a PRO license, or sign in with the Needle Cloud CLI for local builds. If your account has several teams, add --team your-team-id to the license script. The generated file contains a signed JWT, not the Cloud access token, and is ignored by Git. Running ng serve or ng build directly skips license generation and the glTF production step.

Unity export

needle.config.json directs Unity exports to public/assets and code generation to src/generated. src/main.ts imports gen.js and applies its scene URL after Angular has created <needle-engine> in src/app/app.html. The Angular build copies public into its browser output. Do not add a second src attribute to the element.

The sample configures Angular's .glb and .wasm loaders, and externalizes a guarded node:module import used by MaterialX. It does not copy Draco or KTX2 decoders; add those assets if your exported scene requires them. This is an initial Angular integration, tested locally with Angular 21 and a signed PRO license.

About

An Angular CLI sample for Needle Engine with Unity

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages