diff --git a/.gitignore b/.gitignore index 1f3ef99..a0ebe79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.meta Standard Assets -Materials \ No newline at end of file +Materials +.vs diff --git a/README.md b/README.md index 9a12022..0b878d1 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Features: Requirements: ======== -* Unity 2017.2.0 or higher +* Unity 2018.3.0 or higher Contact: ------------ @@ -54,4 +54,4 @@ Contact: References: -------- -* Meshing in a Minecraft Game \[[link](https://0fps.net/2012/07/07/meshing-minecraft-part-2/)\] \ No newline at end of file +* Meshing in a Minecraft Game \[[link](https://0fps.net/2012/07/07/meshing-minecraft-part-2/)\] diff --git a/VOXFileLoader/Scripts/VOXFileImport.cs b/VOXFileLoader/Scripts/VOXFileImport.cs index 98305f5..1c2d370 100644 --- a/VOXFileLoader/Scripts/VOXFileImport.cs +++ b/VOXFileLoader/Scripts/VOXFileImport.cs @@ -570,7 +570,7 @@ public static GameObject LoadVoxelFileAsPrefab(VoxFileData voxel, string name, s gameObject = LoadVoxelFileAsGameObject(name, voxel, lodLevel); var prefabPath = path + name + ".prefab"; - var prefab = PrefabUtility.CreateEmptyPrefab(prefabPath); + var prefab = PrefabUtility.SaveAsPrefabAsset(gameObject, prefabPath); var prefabTextures = new Dictionary(); for (int i = 0; i < gameObject.transform.childCount; i++) @@ -601,7 +601,7 @@ public static GameObject LoadVoxelFileAsPrefab(VoxFileData voxel, string name, s } } - return PrefabUtility.ReplacePrefab(gameObject, prefab, ReplacePrefabOptions.ReplaceNameBased); + return PrefabUtility.SaveAsPrefabAsset(gameObject, prefabPath); } finally { @@ -614,7 +614,6 @@ public static GameObject LoadVoxelFileAsPrefab(string path, string outpath = "As var voxel = VoxFileImport.Load(path); return LoadVoxelFileAsPrefab(voxel, Path.GetFileNameWithoutExtension(path), outpath, lodLevel); } - #endif } }