Skip to content

Latest commit

 

History

History
73 lines (55 loc) · 2.17 KB

README.md

File metadata and controls

73 lines (55 loc) · 2.17 KB

unity-to-json

Node.js package to convert Unity scene and FBX files into JSON


npm package Build Status Issues Code Coverage Commitizen Friendly Semantic Release

Install

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

Usage

Generate files once

import path from 'path';
import { convertUnityProjectToJson } from 'unity-to-json';

const {
  version,
  files
} = await convertUnityProjectToJson({
  unityProjectRootFolderPath: path.resolve('../path/to/unity-project-root'),
});

Generate files and watch for changes

import path from 'path';
import { convertUnityProjectToJson, interpretScene } from 'unity-to-json';

createUnityProjectToJsonWatcher({
  unityProjectRootFolderPath: path.resolve('../path/to/unity-project-root'),
  sceneFilename: 'SampleScene.unity',
  onSceneChange({ version , files }) => {
    // files = all FBX, Unity, Meta files
  }
});

Examples