EditorFileSystem

继承: Node < Object

Resource filesystem, as the editor sees it.

描述

This object holds information of all resources in the filesystem, their types, etc.

Note: This class shouldn't be instantiated directly. Instead, access the singleton using EditorInterface.get_resource_filesystem.

方法


信号

filesystem_changed ( )

Emitted if the filesystem changed.


resources_reimported ( resources: PackedStringArray )

Emitted if a resource is reimported.


resources_reimporting ( resources: PackedStringArray )

Emitted before a resource is reimported.


resources_reload ( resources: PackedStringArray )

Emitted if at least one resource is reloaded when the filesystem is scanned.


script_classes_updated ( )

Emitted when the list of global script classes gets updated.


sources_changed ( exist: bool )

Emitted if the source of any imported file changed.


方法说明

String get_file_type ( path: String ) const1

Returns the resource type of the file, given the full path. This returns a string such as "Resource" or "GDScript", not a file extension such as ".gd".


EditorFileSystemDirectory get_filesystem ( )

Gets the root directory object.


EditorFileSystemDirectory get_filesystem_path ( path: String )

Returns a view into the filesystem at path.


float get_scanning_progress ( ) const1

Returns the scan progress for 0 to 1 if the FS is being scanned.


bool is_scanning ( ) const1

Returns true if the filesystem is being scanned.


void reimport_files ( files: PackedStringArray )

Reimports a set of files. Call this if these files or their .import files were directly edited by script or an external program.

If the file type changed or the file was newly created, use update_file or scan.

Note: This function blocks until the import is finished. However, the main loop iteration, including timers and Node._process, will occur during the import process due to progress bar updates. Avoid calls to reimport_files or scan while an import is in progress.


void scan ( )

Scan the filesystem for changes.


void scan_sources ( )

Check if the source of any imported resource changed.


void update_file ( path: String )

Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program.

This will not import the file. To reimport, call reimport_files or scan methods.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。