Node.js and browser package to parser unity-to-json files into THREE.js instances
npm install unity-to-json-threejs-parser
yarn add unity-to-json-threejs-parser
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)
}
})