EditorFileSystem¶
编辑器可以浏览的资源文件系统。
描述¶
这个对象(object)储存着文件系统里所有的资源的信息,类型和其他。
Note: 这个类(class)不应该被直接实例化。应该使用下列方法(method)EditorInterface.get_resource_filesystem来读取单例(singleton)。
方法¶
get_file_type ( String path ) const |
|
get_filesystem ( ) |
|
get_filesystem_path ( String path ) |
|
get_scanning_progress ( ) const |
|
is_scanning ( ) const |
|
void |
scan ( ) |
void |
scan_sources ( ) |
void |
update_file ( String path ) |
void |
信号¶
filesystem_changed ( )
在文件系统更改的时候触发。
resources_reimported ( PoolStringArray resources )
重新导入资源时触发。
resources_reload ( PoolStringArray resources )
如果在扫描文件系统的时候发现至少一个资源被重载那么触发信号。
sources_changed ( bool exist )
如果导入文件的来源发生变化,则触发。
方法说明¶
返回文件的资源类型,给定完整路径。这将返回字符串,如"Resource"
或"GDScript"
,不是文件扩展名,如".gd"
。
EditorFileSystemDirectory get_filesystem ( )
获取根目录对象。
EditorFileSystemDirectory get_filesystem_path ( String path )
返回在 path
文件系统的视图。
float get_scanning_progress ( ) const
如果文件系统正在被扫描,返回扫描的进度,值为0-1。
bool is_scanning ( ) const
返回 true
如果文件系统已经被扫``描完毕。
void scan ( )
扫描文件系统的改动。
void scan_sources ( )
检查是否更改了已导入资源的来源。
void update_file ( String path )
更新文件信息。如果外部程序(不是Godot)修改了该文件,则调用此函数。
void update_script_classes ( )
扫描脚本文件并且更新自定义类(class)名称列表。