unity-to-json-threejs-parser
v1.3.0
Published
Node.js and browser package to parser unity-to-json files into THREE.js instances
Downloads
2
Maintainers
Readme
unity-to-json-threejs-parser
Node.js and browser package to parser unity-to-json files into THREE.js instances
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)
}
})