Description of the bug
When using FileBrowser.WaitForSaveDialog(...) or FileBrowser.WaitForLoadDialog(...) coroutines, they end before FileBrowser.Success becomes true on android, causing the example coroutine in the readme of the project to not work properly.
Reproduction steps
IEnumerator TestRoutine()
{
yield return FileBrowser.WaitForSaveDialog(
FileBrowser.PickMode.Files,
false,
null,
"save.txt",
"TITLE",
"Save"
);
Debug.Log($"FileBrowser.Success: {FileBrowser.Success}");
if (FileBrowser.Success) // This never becomes true
{
string filePath = FileBrowser.Result[0];
Debug.Log($"File path: {filePath}");
FileBrowserHelpers.WriteTextToFile(filePath, "test file content 123123");
Debug.Log("Saved");
}
}
If I additionally wait for FileBrowser.Success to become true, the rest of the code works fine, but now if the user clicks the "Cancel" button, the coroutine would get stuck waiting forever.
IEnumerator TestRoutine()
{
yield return FileBrowser.WaitForSaveDialog(
FileBrowser.PickMode.Files,
false,
null,
"save.txt",
"TITLE",
"Save"
);
yield return new WaitUntil(() => FileBrowser.Success); // This line is needed to actually wait for the dialog to finish
Debug.Log($"FileBrowser.Success: {FileBrowser.Success}");
if (FileBrowser.Success)
{
string filePath = FileBrowser.Result[0];
Debug.Log($"File path: {filePath}");
FileBrowserHelpers.WriteTextToFile(filePath, "test file content 123123");
Debug.Log("Saved");
}
}
Platform specs
- Unity version: 2022.3.50f1
- Platform: Android
- Device: Samsung Galaxy A55 5G
- How did you download the plugin: github repo link in manifest.json
Description of the bug
When using
FileBrowser.WaitForSaveDialog(...)orFileBrowser.WaitForLoadDialog(...)coroutines, they end beforeFileBrowser.Successbecomestrueon android, causing the example coroutine in the readme of the project to not work properly.Reproduction steps
If I additionally wait for
FileBrowser.Successto become true, the rest of the code works fine, but now if the user clicks the "Cancel" button, the coroutine would get stuck waiting forever.Platform specs