Editor Fix

This commit is contained in:
Syntriax 2022-12-18 23:51:27 +03:00
parent c244ddeb98
commit 57790c4598
1 changed files with 3 additions and 2 deletions

View File

@ -142,8 +142,9 @@ namespace Syntriax.Modules.Movement.Editor
string jsonText = JsonUtility.ToJson(definition, true);
string path = $"Assets/Resources/{MovementDefinitionFactory.ResourceDirectoryToDefinitions}{definition.Name}.json";
if (!EditorUtility.DisplayDialog("Conflict", $"\"{path}\" already exists, do you want to overwrite?", "Overwrite", "Cancel"))
return;
if (System.IO.File.Exists($"{Application.dataPath}/Resources/{MovementDefinitionFactory.ResourceDirectoryToDefinitions}{definition.Name}.json"))
if (!EditorUtility.DisplayDialog("Conflict", $"\"{path}\" already exists, do you want to overwrite?", "Overwrite", "Cancel"))
return;
System.IO.File.WriteAllText(path, jsonText);
AssetDatabase.Refresh();