Example #1
0
        public void hardClean()
        {
            softClean();

            for (int i = 0; i < _createdGameObjects.Count; ++i)
            {
                Object.DestroyImmediate(_createdGameObjects[i]);
            }

            GLTFUtils.removeFileList(_generatedFiles.ToArray());
            AssetDatabase.Refresh(); // also triggers Resources.UnloadUnusedAssets()

            // Remove directories if empty
            GLTFUtils.removeEmptyDirectory(_importMeshesDirectory);
            GLTFUtils.removeEmptyDirectory(_importTexturesDirectory);
            GLTFUtils.removeEmptyDirectory(_importMaterialsDirectory);
            GLTFUtils.removeEmptyDirectory(_importAnimationDirectory);
            _createdGameObjects.Clear();

            AssetDatabase.Refresh(); // also triggers Resources.UnloadUnusedAssets()
            GLTFUtils.removeEmptyDirectory(_importDirectory);
            AssetDatabase.Refresh(); // also triggers Resources.UnloadUnusedAssets()
        }
 public void OnDestroy()
 {
     GLTFUtils.removeFileList(_unzippedFiles.ToArray());
     GLTFUtils.removeEmptyDirectory(_unzipDirectory);
 }