diff --git a/tutorials/plugins/editor/making_main_screen_plugins.rst b/tutorials/plugins/editor/making_main_screen_plugins.rst index 9345d83e0..2c1340f18 100644 --- a/tutorials/plugins/editor/making_main_screen_plugins.rst +++ b/tutorials/plugins/editor/making_main_screen_plugins.rst @@ -92,7 +92,7 @@ Add five extra methods such that the script looks like this: public override Texture2D _GetPluginIcon() { - return EditorInterface.GetEditorTheme().GetIcon("Node", "EditorIcons"); + return EditorInterface.Singleton.GetEditorTheme().GetIcon("Node", "EditorIcons"); } } #endif @@ -210,7 +210,7 @@ Here is the full plugin script: { MainPanelInstance = (Control)MainPanel.Instantiate(); // Add the main panel to the editor's main viewport. - EditorInterface.GetEditorMainScreen().AddChild(MainPanelInstance); + EditorInterface.Singleton.GetEditorMainScreen().AddChild(MainPanelInstance); // Hide the main panel. Very much required. _MakeVisible(false); } @@ -244,7 +244,7 @@ Here is the full plugin script: public override Texture2D _GetPluginIcon() { // Must return some kind of Texture for the icon. - return EditorInterface.GetEditorTheme().GetIcon("Node", "EditorIcons"); + return EditorInterface.Singleton.GetEditorTheme().GetIcon("Node", "EditorIcons"); } } #endif diff --git a/tutorials/scripting/c_sharp/c_sharp_differences.rst b/tutorials/scripting/c_sharp/c_sharp_differences.rst index e5c872b96..ee81fbd8e 100644 --- a/tutorials/scripting/c_sharp/c_sharp_differences.rst +++ b/tutorials/scripting/c_sharp/c_sharp_differences.rst @@ -363,6 +363,17 @@ Example: Input.Singleton.JoyConnectionChanged += Input_JoyConnectionChanged; +If you are developing main screen plugins using C#, it is essential to note the +distinctions between ``GDScript`` and ``C#`` during setup. Unlike in ``GDScript``, +this portion is not a static class in ``C#``. Consequently, you must employ the singleton +pattern to obtain an instance of the ``EditorInterface``: + +==================== ============================================================== +GDScript C# +==================== ============================================================== +``EditorInterface`` ``EditorInterface.Singleton`` +==================== ============================================================== + String ------