1.2.0 • Published 8 months ago

unity-to-json v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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