Skip to content

Node.js and browser package to parser unity-to-json files into THREE.js instances

License

Notifications You must be signed in to change notification settings

filipemeneses/unity-to-json-threejs-parser

Repository files navigation

unity-to-json-threejs-parser

Node.js and browser package to parser unity-to-json files into THREE.js instances


npm package Build Status Issues Code Coverage Commitizen Friendly Semantic Release

Install

npm install unity-to-json-threejs-parser
yarn add unity-to-json-threejs-parser

Usage

import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import unityScene from './unity-scene.json'; // generated using unity-to-json

const parseUnityJsonToThreejs = createUnityJsonToThreeJsParser({
    THREE,
    GLTFLoader
});
const instances = await parseUnityJsonToThreejs('MyScene', unityContext);

instance.forEach(threejsItem => {
    if (threejsItem instanceof THREE.Group) {
        // add to scene
        // scene.add(threeJsGroup)
    }
})

Examples

About

Node.js and browser package to parser unity-to-json files into THREE.js instances

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published