Make EditorInterface accessible as a singleton

- EditorPlugin.get_editor_interface() is removed as redundant.
This commit is contained in:
Yuri Sizov
2023-08-09 14:03:27 +02:00
parent f7bc653cbe
commit 951ea2415b
13 changed files with 37 additions and 25 deletions

View File

@ -5,7 +5,16 @@
</brief_description>
<description>
[EditorInterface] gives you control over Godot editor's window. It allows customizing the window, saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects, and provides access to [EditorSettings], [EditorFileSystem], [EditorResourcePreview], [ScriptEditor], the editor viewport, and information about scenes.
[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorPlugin.get_editor_interface].
[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton directly by its name.
[codeblocks]
[gdscript]
var editor_settings = EditorInterface.get_editor_settings()
[/gdscript]
[csharp]
// In C# you can access it via the static Singleton property.
EditorSettings settings = EditorInterface.Singleton.GetEditorSettings();
[/csharp]
[/codeblocks]
</description>
<tutorials>
</tutorials>