mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 06:34:16 +00:00
fix saving
This commit is contained in:
parent
c1cf249e8a
commit
6ecc9c11c0
1 changed files with 19 additions and 3 deletions
|
@ -135,10 +135,26 @@ namespace SanAndreasUnity.Editor
|
|||
{
|
||||
EditorUtility.DisplayProgressBar("", "Saving nav mesh...", 1f);
|
||||
|
||||
AssetDatabase.CreateAsset(m_navMeshData, saveFilePath);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (AssetDatabase.Contains(m_navMeshData))
|
||||
{
|
||||
NavMesh.RemoveAllNavMeshData();
|
||||
UnityEditor.AI.NavMeshBuilder.ClearAllNavMeshes();
|
||||
m_navMeshDataInstance = new NavMeshDataInstance();
|
||||
|
||||
EditorUtility.ClearProgressBar();
|
||||
m_navMeshData = Object.Instantiate(m_navMeshData);
|
||||
|
||||
m_navMeshDataInstance = NavMesh.AddNavMeshData(m_navMeshData);
|
||||
}
|
||||
|
||||
AssetDatabase.CreateAsset(m_navMeshData, saveFilePath);
|
||||
}
|
||||
finally
|
||||
{
|
||||
EditorUtility.ClearProgressBar();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Generate()
|
||||
|
|
Loading…
Reference in a new issue