Skip to content

格式

typescript
Directory.Exists(path)

所属类: Directory

描述

判断指定的目录是否存在。

参数

参数名类型描述
pathstring指定目录

返回值

类型描述
boolean是否存在

代码示例

typescript
//创建目录
Directory.Create("Assets/newPath");
//判断当前目录是否存在
let result = Directory.Exists("Assets/newPath");
if (result) {
    Debug.Log("存在当前目录");
}else{
    Debug.Log("当前目录不存在");
}