﻿using System;
using System.Diagnostics;
using System.IO;
using Debug = UnityEngine.Debug;

public static class FileUtil
{
    public static void DeleteDirectory(string path)
    {
        if (!Directory.Exists(path))
        {
            Debug.LogErrorFormat("Not found directory : {0}", path);
            return;
        }

        try
        {
            var info = new DirectoryInfo(path);
            if (info != null)
                info.Delete(true);
            Debug.LogFormat("Success to delete directory : {0}", path);
        }
        catch (Exception ex)
        {
            Debug.LogException(ex);
        }
    }
}
