I’m making a game which involves the player coding in lua, so naturally I need to allow them to create and edit .lua files. I have a system for file management in place right now, storing .lua files in the StreamingAssets folder, and I have a script attached to my UI made that displays all of the .lua files in the folder, and allows for the creation and deletion of said files.
This all works fine, except that when a file is deleted in the same instance it is created (i.e. play game, create file, delete same file), the file cannot be accessed because while it is technically there, the streaming assets folder is not refreshed. It works as expected if I manually refresh the streaming assets folder while the game is running.
I know that AssetDatabase.Refresh is obsolete outside of the editor. Anyone have any methods they use to refresh a folder/files that work in the built game?
I’m working in C# by the way, here is some of the code commented up and I can give you more if you need it: Create/Delete file - Pastebin.com
Thank you for any advice you can spare!