@@ -344,18 +344,28 @@ use crate::util::{bail, ident, KvParser};
344
344
///
345
345
/// ## Editor plugins
346
346
///
347
- /// If you annotate a class with `#[class(editor_plugin)]`, it will be turned into an editor plugin. The
348
- /// class must then inherit from `EditorPlugin`, and an instance of that class will be automatically added
347
+ /// Classes inheriting `EditorPlugin` will be automatically instantiated and added
349
348
/// to the editor when launched.
350
349
///
351
350
/// See [Godot's documentation of editor plugins](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/index.html)
352
351
/// for more information about editor plugins. But note that you do not need to create and enable the plugin
353
- /// through Godot's `Create New Plugin` menu for it to work, simply annotating the class with `editor_plugin `
352
+ /// through Godot's `Create New Plugin` menu for it to work, simply creating the class which inherits `EditorPlugin `
354
353
/// automatically enables it when the library is loaded.
355
354
///
356
355
/// This should usually be combined with `#[class(tool)]` so that the code you write will actually run in the
357
356
/// editor.
358
357
///
358
+ /// ### Editor plugins -- hot reload interaction
359
+ ///
360
+ /// During hot reload, Godot firstly unloads `EditorPlugin`s, then changes all alive GDExtension classes instances into their base objects
361
+ /// (classes inheriting `Resource` become `Resource`, classes inheriting `Node` become `Node` and so on), then reloads all the classes,
362
+ /// and finally changes said instances back into their proper classes.
363
+ ///
364
+ /// `EditorPlugin` will be re-added to the editor before the last step (changing instances from base classes to extension classes) is finished,
365
+ /// which might cause issues with loading already cached resources and instantiated nodes.
366
+ ///
367
+ /// In such a case, await one frame until extension is properly hot-reloaded (See: [`godot::task::spawn()`](../task/fn.spawn.html)).
368
+ ///
359
369
/// ## Class renaming
360
370
///
361
371
/// You may want to have structs with the same name. With Rust, this is allowed using `mod`. However, in GDScript
0 commit comments