Class EditorFileSystem
- Namespace
- Godot
- Assembly
- GodotSharpEditor.dll
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 GetResourceFilesystem().
public class EditorFileSystem : Node, IDisposable
- Inheritance
-
EditorFileSystem
- Implements
- Inherited Members
Methods
GetFileType(string)
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"
.
public string GetFileType(string path)
Parameters
path
string
Returns
GetFilesystem()
Gets the root directory object.
public EditorFileSystemDirectory GetFilesystem()
Returns
GetFilesystemPath(string)
Returns a view into the filesystem at path
.
public EditorFileSystemDirectory GetFilesystemPath(string path)
Parameters
path
string
Returns
GetScanningProgress()
Returns the scan progress for 0 to 1 if the FS is being scanned.
public float GetScanningProgress()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
IsScanning()
Returns true
if the filesystem is being scanned.
public bool IsScanning()
Returns
ReimportFiles(string[])
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 UpdateFile(string) or Scan().
Note: This function blocks until the import is finished. However, the main loop iteration, including timers and _Process(double), will occur during the import process due to progress bar updates. Avoid calls to ReimportFiles(string[]) or Scan() while an import is in progress.
public void ReimportFiles(string[] files)
Parameters
files
string[]
Scan()
Scan the filesystem for changes.
public void Scan()
ScanSources()
Check if the source of any imported resource changed.
public void ScanSources()
UpdateFile(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 ReimportFiles(string[]) or Scan() methods.
public void UpdateFile(string path)
Parameters
path
string
Events
FilesystemChanged
Emitted if the filesystem changed.
public event Action FilesystemChanged
Event Type
ResourcesReimported
Emitted if a resource is reimported.
public event EditorFileSystem.ResourcesReimportedEventHandler ResourcesReimported
Event Type
ResourcesReload
Emitted if at least one resource is reloaded when the filesystem is scanned.
public event EditorFileSystem.ResourcesReloadEventHandler ResourcesReload
Event Type
ScriptClassesUpdated
Emitted when the list of global script classes gets updated.
public event Action ScriptClassesUpdated
Event Type
SourcesChanged
Emitted if the source of any imported file changed.
public event EditorFileSystem.SourcesChangedEventHandler SourcesChanged