format
typescript
Directory.Exists(path)class: Directory
description
Check if the specified directory exists.
parameter
| param_name | type | description |
|---|---|---|
| path | string | The specified directory. |
return
| type | description |
|---|---|
boolean | Whether the directory exists. |
code example
typescript
// Create a directory
Directory.Create("Assets/newPath");
// Check if the current directory exists
let result = Directory.Exists("Assets/newPath");
if (result) {
Debug.Log("The current directory exists");
} else {
Debug.Log("The current directory does not exist");
}