Enum godot::init::EditorRunBehavior
#[non_exhaustive]pub enum EditorRunBehavior {
ToolClassesOnly,
AllClasses,
}
Expand description
Determines if and how an extension’s code is run in the editor.
By default, Godot 4 runs all virtual lifecycle callbacks (_ready
, _process
, _physics_process
, …)
for extensions. This behavior is different from Godot 3, where extension classes needed to be explicitly
marked as “tool”.
In many cases, users write extension code with the intention to run in games, not inside the editor.
This is why the default behavior in gdext deviates from Godot: lifecycle callbacks are disabled inside the
editor (see ToolClassesOnly
). It is possible to configure this.
See also ExtensionLibrary::editor_run_behavior()
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ToolClassesOnly
Only runs #[class(tool)]
classes in the editor.
All classes are registered, and calls from GDScript to Rust are possible. However, virtual lifecycle callbacks
(_ready
, _process
, _physics_process
, …) are not run unless the class is annotated with #[class(tool)]
.
AllClasses
Runs the extension with full functionality in editor.
Ignores any #[class(tool)]
annotations.
Trait Implementations§
§impl Clone for EditorRunBehavior
impl Clone for EditorRunBehavior
§fn clone(&self) -> EditorRunBehavior
fn clone(&self) -> EditorRunBehavior
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for EditorRunBehavior
impl Debug for EditorRunBehavior
impl Copy for EditorRunBehavior
Auto Trait Implementations§
impl Freeze for EditorRunBehavior
impl RefUnwindSafe for EditorRunBehavior
impl Send for EditorRunBehavior
impl Sync for EditorRunBehavior
impl Unpin for EditorRunBehavior
impl UnwindSafe for EditorRunBehavior
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)