Path.GetExtension(path) returns the extension with the dot. IE ".json". Code needs to change to
public IEnumerable<string> ListSaves() {
foreach (string path in Directory.EnumerateFiles(dataPath)) {
if (Path.GetExtension(path) == $".{fileExtension}") {
yield return Path.GetFileNameWithoutExtension(path);
}
}
}
Path.GetExtension(path) returns the extension with the dot. IE ".json". Code needs to change to