Godot Version
4.2.2
Question
On a Game Over I am deleting saved game data :
private void DeleteSaveData()
{
if (ResourceLoader.Exists(Main.SavePath))
{
DirAccess.RemoveAbsolute(Main.SavePath);
}
}
Then i reload the current scene, and after that I am trying to load game data (in case it was not a Game Over:
private void LoadGame()
{
if (ResourceLoader.Exists(Main.SavePath))
{
data = ResourceLoader.Load<PlayerData>(Main.SavePath);
}
}
In this case the resource should NOT exist and therefore continue like a new game.
But the resource is still there and therefore the functionality is broken.
I suspect that DirAccess.RemoveAbsolute is using async code under the hood, but I cannot await this method.
Any suggestions?