Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

EditorFileSystemDirectory

继承: Object

资源文件系统的目录。

描述

目录概念的一个更概括的、低级的概念。

方法

int

find_dir_index ( String name ) const

int

find_file_index ( String name ) const

String

get_file ( int idx ) const

int

get_file_count ( ) const

bool

get_file_import_is_valid ( int idx ) const

String

get_file_path ( int idx ) const

String

get_file_script_class_extends ( int idx ) const

String

get_file_script_class_name ( int idx ) const

StringName

get_file_type ( int idx ) const

String

get_name ( )

EditorFileSystemDirectory

get_parent ( )

String

get_path ( ) const

EditorFileSystemDirectory

get_subdir ( int idx )

int

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

返回这个目录的子目录的数量。