Alternative for FileUtil in Build

Hi everyone,

I’ve just learned that “using UnityEditor” wasn’t used in builds.
My problem is that i’ve used FileUtil.DeleteFileOrDirectory to delete a file at a given path. And i need to use UnityEditor to use FileUtil.
I know that it’s impossible to use UnityEditor for builds, so i ask if there is any alternative for FileUtil.DeleteFileOrDirectory without UnityEditor (for builds).

Thank you very much, have a nice day.

You would simply use the usual classes defined in the System.IO namespace. Specifically the File and the Directory class. DirectoryInfo and FileInfo are also quite useful in some cases.