Version: 2017.2

FileUtil.DeleteFileOrDirectory

Cambiar al Manual
public static bool DeleteFileOrDirectory (string path);

Descripción

Elimina el archivo o directorio de la ruta indicada.

This function's path is relative to the project root folder but it can also accept absolute paths.

All file separators should be forward ones "/" (Unix style).

using UnityEngine;
using UnityEditor;

public class DeleteFile : MonoBehaviour { [MenuItem("Example/Delete Something")] static void DeleteSomething() { FileUtil.DeleteFileOrDirectory("yourPath/YourFileOrFolder"); } }