Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

EditorFileSystemDirectory

繼承: Object

資源檔系統的目錄。

說明

目錄概念的一個更概括的、低級的概念。

方法

int

find_dir_index(name: String) const

int

find_file_index(name: String) const

String

get_file(idx: int) const

int

get_file_count() const

bool

get_file_import_is_valid(idx: int) const

String

get_file_path(idx: int) const

String

get_file_script_class_extends(idx: int) const

String

get_file_script_class_name(idx: int) const

StringName

get_file_type(idx: int) const

String

get_name()

EditorFileSystemDirectory

get_parent()

String

get_path() const

EditorFileSystemDirectory

get_subdir(idx: int)

int

get_subdir_count() const


方法說明

int find_dir_index(name: String) const 🔗

返回名為 name 的目錄索引,如果未找到返回 -1


int find_file_index(name: String) const 🔗

返回名為 name 的檔索引,如果未找到返回 -1


String get_file(idx: int) const 🔗

返回索引 idx 處的檔案名。


int get_file_count() const 🔗

返回目錄裡檔的數量。


bool get_file_import_is_valid(idx: int) const 🔗

如果索引 idx 處的檔正確匯入,則返回 true


String get_file_path(idx: int) const 🔗

返回索引 idx 處的檔所在路徑。


String get_file_script_class_extends(idx: int) const 🔗

返回在索引 idx 的檔中定義的腳本類的基底類別。如果該檔未使用 class_name 語法定義腳本類,則返回空字串。


String get_file_script_class_name(idx: int) const 🔗

返回索引 idx 處檔中定義的腳本類的名稱。如果檔沒有使用 class_name 語法定義腳本類,這將返回一個空字串。


StringName get_file_type(idx: int) const 🔗

返回在索引 idx 處檔案的資源型別。返回的是類似 "Resource""GDScript" 的字串,而不是類似 ".gd" 的檔案副檔名。


String get_name() 🔗

返回這個目錄的名字。


EditorFileSystemDirectory get_parent() 🔗

返回這個目錄的上層目錄,如果在 res://user:// 調用這個方法,將會返回 null


String get_path() const 🔗

返回這個目錄的路徑。


EditorFileSystemDirectory get_subdir(idx: int) 🔗

返回在索引 idx 處的子目錄。


int get_subdir_count() const 🔗

返回這個目錄的子目錄的數量。