EditorFileSystem
編輯器可以流覽的資源檔系統。
說明
這個物件儲存著檔案系統裡所有的資源的資訊,型別和其他。
注意:這個類不應該被直接產生實體。應該使用下列方法 EditorInterface.get_resource_filesystem() 來讀取單例。
方法
get_file_type(path: String) const |
|
get_filesystem_path(path: String) |
|
get_scanning_progress() const |
|
is_scanning() const |
|
void |
reimport_files(files: PackedStringArray) |
void |
scan() |
void |
|
void |
update_file(path: String) |
訊號
filesystem_changed() 🔗
在檔案系統更改的時候觸發。
resources_reimported(resources: PackedStringArray) 🔗
重新匯入資源時觸發。
resources_reimporting(resources: PackedStringArray) 🔗
Emitted before a resource is reimported.
resources_reload(resources: PackedStringArray) 🔗
如果在掃描檔案系統的時候,至少有一個資源被重新載入,則觸發該訊號。
script_classes_updated() 🔗
更新全域腳本類列表時觸發。
sources_changed(exist: bool) 🔗
如果匯入檔的來源發生變化,則觸發。
方法說明
String get_file_type(path: String) const 🔗
返回呼函式的資源型別,給定完整路徑。這將返回字串,如 "Resource" 或 "GDScript",不是檔副檔名,如 ".gd"。
EditorFileSystemDirectory get_filesystem() 🔗
獲取根目錄物件。
EditorFileSystemDirectory get_filesystem_path(path: String) 🔗
返回在 path 下檔案系統的視圖。
float get_scanning_progress() const 🔗
如果檔案系統正在被掃描,返回掃描的進度,值為 0-1。
如果檔案系統正在進行掃描,則返回 true。
void reimport_files(files: PackedStringArray) 🔗
重新匯入一組檔。如果這些檔或其 .import 檔案是由腳本或外部程序直接編輯的,請呼叫此函式。
如果檔案型別已更改或檔是新建立的,請使用 update_file() 或 scan()。
注意:此函式會阻塞,直到匯入完成。但由於進度條更新,主迴圈反覆運算,包括計時器和 Node._process(),將在匯入過程中發生。避免在匯入正在進行時呼叫 reimport_files() 或 scan()。
void scan() 🔗
掃描檔案系統的改動。
void scan_sources() 🔗
檢查是否更改了已匯入資源的來源。
void update_file(path: String) 🔗
在現有目錄中新增檔,或計畫在編輯器重新開機時更新檔資訊。可用於更新由外部程式保存的文字檔。
這不會匯入檔。要重新匯入,請呼叫 reimport_files() 或 scan() 方法。