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.
Checking the stable version of the documentation...
EditorFileSystemDirectory¶
继承: Object
资源文件系统的目录。
描述¶
目录概念的一个更概括的、低级的概念。
方法¶
find_dir_index ( String name ) const |
|
find_file_index ( String name ) const |
|
get_file_count ( ) const |
|
get_file_import_is_valid ( int idx ) const |
|
get_file_path ( int idx ) const |
|
get_file_script_class_extends ( int idx ) const |
|
get_file_script_class_name ( int idx ) const |
|
get_file_type ( int idx ) const |
|
get_name ( ) |
|
get_parent ( ) |
|
get_path ( ) const |
|
get_subdir ( int idx ) |
|
get_subdir_count ( ) const |
方法说明¶
int find_dir_index ( String name ) const
返回名为 name
的目录索引,如果未找到返回 -1
。
int find_file_index ( String name ) const
返回名为 name
的文件索引,如果未找到返回 -1
。
String get_file ( int idx ) const
返回索引 idx
处的文件名。
int get_file_count ( ) const
返回目录里文件的数量。
bool get_file_import_is_valid ( int idx ) const
如果索引 idx
处的文件正确导入,则返回 true
。
String get_file_path ( int idx ) const
返回索引 idx
处的文件所在路径。
String get_file_script_class_extends ( int idx ) const
返回在索引 idx
的文件中定义的脚本类的基类。如果该文件未使用 class_name
语法定义脚本类,则返回空字符串。
String get_file_script_class_name ( int idx ) const
返回索引 idx
处文件中定义的脚本类的名称。如果文件没有使用 class_name
语法定义脚本类,这将返回一个空字符串。
StringName get_file_type ( int idx ) const
返回在索引 idx
处文件的资源类型。返回的是类似 "Resource"
和 "GDScript"
的字符串,而不是类似 ".gd"
的文件扩展名。
String get_name ( )
返回这个目录的名字。
EditorFileSystemDirectory get_parent ( )
返回这个目录的上层目录,如果在 res://
或 user://
调用这个方法,将会返回 null
。
String get_path ( ) const
返回这个目录的路径。
EditorFileSystemDirectory get_subdir ( int idx )
返回在索引 idx
处的子目录。
int get_subdir_count ( ) const
返回这个目录的子目录的数量。