diff --git a/Editor/DefinitionCreatorEditor.cs b/Editor/DefinitionCreatorEditor.cs index f1257a5..2472678 100644 --- a/Editor/DefinitionCreatorEditor.cs +++ b/Editor/DefinitionCreatorEditor.cs @@ -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();