Skip to content

Update API for obsolete methods #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.meta
Standard Assets
Materials
Materials
.vs
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Features:

Requirements:
========
* Unity 2017.2.0 or higher
* Unity 2018.3.0 or higher

Contact:
------------
Expand Down Expand Up @@ -54,4 +54,4 @@ Contact:

References:
--------
* Meshing in a Minecraft Game \[[link](https://0fps.net/2012/07/07/meshing-minecraft-part-2/)\]
* Meshing in a Minecraft Game \[[link](https://0fps.net/2012/07/07/meshing-minecraft-part-2/)\]
5 changes: 2 additions & 3 deletions VOXFileLoader/Scripts/VOXFileImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, int>();

for (int i = 0; i < gameObject.transform.childCount; i++)
Expand Down Expand Up @@ -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
{
Expand All @@ -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
}
}
Expand Down