Editor Fix
This commit is contained in:
parent
c244ddeb98
commit
57790c4598
|
@ -142,8 +142,9 @@ namespace Syntriax.Modules.Movement.Editor
|
||||||
string jsonText = JsonUtility.ToJson(definition, true);
|
string jsonText = JsonUtility.ToJson(definition, true);
|
||||||
string path = $"Assets/Resources/{MovementDefinitionFactory.ResourceDirectoryToDefinitions}{definition.Name}.json";
|
string path = $"Assets/Resources/{MovementDefinitionFactory.ResourceDirectoryToDefinitions}{definition.Name}.json";
|
||||||
|
|
||||||
if (!EditorUtility.DisplayDialog("Conflict", $"\"{path}\" already exists, do you want to overwrite?", "Overwrite", "Cancel"))
|
if (System.IO.File.Exists($"{Application.dataPath}/Resources/{MovementDefinitionFactory.ResourceDirectoryToDefinitions}{definition.Name}.json"))
|
||||||
return;
|
if (!EditorUtility.DisplayDialog("Conflict", $"\"{path}\" already exists, do you want to overwrite?", "Overwrite", "Cancel"))
|
||||||
|
return;
|
||||||
|
|
||||||
System.IO.File.WriteAllText(path, jsonText);
|
System.IO.File.WriteAllText(path, jsonText);
|
||||||
AssetDatabase.Refresh();
|
AssetDatabase.Refresh();
|
||||||
|
|
Loading…
Reference in New Issue