{"id":13662927,"url":"https://github.com/SrejonKhan/AnotherFileBrowser","last_synced_at":"2025-04-25T13:30:40.870Z","repository":{"id":38446202,"uuid":"319398878","full_name":"SrejonKhan/AnotherFileBrowser","owner":"SrejonKhan","description":"Just another File Dialog for Unity, with easy implementation.","archived":false,"fork":false,"pushed_at":"2024-02-10T18:47:08.000Z","size":1659,"stargazers_count":49,"open_issues_count":3,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-10T19:32:56.518Z","etag":null,"topics":["file-browser","file-dialog","file-explorer","ookii-dialogs","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SrejonKhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-12-07T17:47:12.000Z","updated_at":"2024-09-30T18:57:00.000Z","dependencies_parsed_at":"2024-02-10T19:47:21.068Z","dependency_job_id":null,"html_url":"https://github.com/SrejonKhan/AnotherFileBrowser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrejonKhan%2FAnotherFileBrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrejonKhan%2FAnotherFileBrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrejonKhan%2FAnotherFileBrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SrejonKhan%2FAnotherFileBrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SrejonKhan","download_url":"https://codeload.github.com/SrejonKhan/AnotherFileBrowser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250824844,"owners_count":21493349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-browser","file-dialog","file-explorer","ookii-dialogs","unity"],"created_at":"2024-08-02T05:02:12.320Z","updated_at":"2025-04-25T13:30:39.637Z","avatar_url":"https://github.com/SrejonKhan.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# AnotherFileBrowser\n\nJust another File Dialog for Unity, with easy implementation. Using Ookii Dialogs Winforms. Rather than putting everything in .dll, i've done this simply with a class, so you can extend it based on Ookii Dialogs Winforms.\n\n![alt-text](demo.gif)\n\n# Getting Started\n\nOpen Package Manager in Unity and Click on Plus Icon -\u003e Add package from git URL, paste following link `https://github.com/SrejonKhan/AnotherFileBrowser.git` and click Add.\n\nAfter importing, change **Change API Compatibility Level** to **_.NET 4.x_**, from `Project Settings -\u003e Player -\u003e Other Settings`. And, change **Scripting Backend** to **_Mono_**.\n\nFor example, go to `Packages -\u003e Another File Browser -\u003e Example` in Project View, then import `Example.unitypackage`.\n\n# Implementation\n\nImplementation is quite easy, but before implementing let's know about **BrowserProperties** constructor.\n\n**BrowserProperties**\n\n```csharp\npublic class BrowserProperties\n{\n    public string title; //Title of the Dialog\n    public string initialDir; //Where dialog will be opened initially\n    public string filter; //aka File Extension for filtering files\n    public int filterIndex; //Index of filter, if there is multiple filter. Default is 0.\n    public bool restoreDirectory = true; //Restore to last return directory\n\n\n    public BrowserProperties() { }\n    public BrowserProperties(string title) { this.title = title; }\n}\n```\n\nMake sure to define `AnotherFileBrowser.Windows` namespace.\n\n### Picking a Single File\n\n```csharp\nvar bp = new BrowserProperties();\nbp.filter = \"txt files (*.txt)|*.txt|All Files (*.*)|*.*\";\nbp.filterIndex = 0;\n\nnew FileBrowser().OpenFileBrowser(bp, path =\u003e\n{\n    //Do something with path(string)\n    Debug.Log(path);\n});\n```\n\n### Picking Multiple File(s)\n\n```csharp\nvar bp = new BrowserProperties();\nbp.filter = \"txt files (*.txt)|*.txt|All Files (*.*)|*.*\";\nbp.filterIndex = 0;\n\nnew FileBrowser().OpenMultiSelectFileBrowser(bp, path =\u003e\n{\n    //Do something with path(string[])\n    string s = \"\";\n    for (int i = 0; i \u003c path.Length; i++)\n    {\n        s += path[i] + \"\\n\";\n    }\n\n});\n```\n\n### Picking Folder Path\n\n```csharp\nvar bp = new BrowserProperties();\nbp.filter = \"txt files (*.txt)|*.txt|All Files (*.*)|*.*\";\nbp.filterIndex = 0;\n\nnew FileBrowser().OpenFolderBrowser(bp, path =\u003e\n{\n    //Do something with path(string)\n    Debug.Log(path);\n});\n```\n\n### Picking Path for Saving File\n\n```csharp\nvar bp = new BrowserProperties();\nbp.filter = \"txt files (*.txt)|*.txt\";\nbp.filterIndex = 0;\n\nnew FileBrowser().SaveFileBrowser(bp, \"test\", \".txt\", path =\u003e\n{\n    //Do something with path(string)\n    Debug.Log(path);\n});\n```\n\n### Picking and Loading Image\n\n```csharp\nvar bp = new BrowserProperties();\nbp.filter = \"Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png\";\nbp.filterIndex = 0;\n\nnew FileBrowser().OpenFileBrowser(bp, path =\u003e\n{\n    //Load image from local path with UWR\n    StartCoroutine(LoadImage(path));\n});\n\n//Load Image from Local\nIEnumerator LoadImage(string path)\n{\n    using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(path))\n    {\n        yield return uwr.SendWebRequest();\n\n        if (uwr.isNetworkError || uwr.isHttpError)\n        {\n            Debug.Log(uwr.error);\n        }\n        else\n        {\n            var uwrTexture = DownloadHandlerTexture.GetContent(uwr);\n            //placeholderImage is an Image Component of Unity UI\n            placeholderImage.sprite = Sprite.Create(uwrTexture, new Rect(0, 0, uwrTexture.width, uwrTexture.height), new Vector2(0, 0));\n        }\n    }\n}\n```\n\n#### Pro-Tips\n\nUse preprocessor for [Platform Dependent Compilation](https://docs.unity3d.com/Manual/PlatformDependentCompilation.html), so there won't be any issue while building for other platforms.\n\n#### IL2CPP Support\n\nI'm facing crashes if try to open dialog from il2cpp build. If you want to try in il2cpp, you need to add `Mono.Posix` \u0026 `Mono.WebBrowser` from `C:\\Program Files\\Unity\\Editor\\Data\\MonoBleedingEdge\\lib\\mono\\gac` to `\\Plugins` folder.\n\nThere must be a workaround, you can check crash logs after crash. I will try to fix it, if you already fixed it, open a PR, it would be highly appreciated.\n\n# Android / iOS Support\n\nThis is only for Windows. You can check out [UnityNativeFilePicker](https://github.com/yasirkula/UnityNativeFilePicker) by Yasirkula. There are plenty of native plugins, but this one support iOS too.\n\n# Contacts\n\n### Srejon Khan\n\nIndie Game Programmer\n\n**Mail:** srejonkhan9@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSrejonKhan%2FAnotherFileBrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSrejonKhan%2FAnotherFileBrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSrejonKhan%2FAnotherFileBrowser/lists"}