diff --git a/fyrox-impl/src/scene/node/constructor.rs b/fyrox-impl/src/scene/node/constructor.rs index 9a7217182..25fbb7a61 100644 --- a/fyrox-impl/src/scene/node/constructor.rs +++ b/fyrox-impl/src/scene/node/constructor.rs @@ -36,19 +36,11 @@ pub struct NodeConstructor { } /// A special container that is able to create nodes by their type UUID. - +#[derive(Default)] pub struct NodeConstructorContainer { map: Mutex>, } -impl Default for NodeConstructorContainer { - fn default() -> Self { - Self { - map: Default::default(), - } - } -} - impl NodeConstructorContainer { /// Creates default node constructor container with constructors for built-in engine nodes. pub fn new() -> Self { diff --git a/fyrox-impl/src/script/constructor.rs b/fyrox-impl/src/script/constructor.rs index 99ad8f35f..da763e535 100644 --- a/fyrox-impl/src/script/constructor.rs +++ b/fyrox-impl/src/script/constructor.rs @@ -27,19 +27,12 @@ pub struct ScriptConstructor { } /// A special container that is able to create nodes by their type UUID. +#[derive(Default)] pub struct ScriptConstructorContainer { // BTreeMap allows to have sorted list of constructors. map: Mutex>, } -impl Default for ScriptConstructorContainer { - fn default() -> Self { - Self { - map: Default::default(), - } - } -} - impl ScriptConstructorContainer { /// Creates default node constructor container with constructors for built-in engine nodes. pub fn new() -> Self { diff --git a/template/src/main.rs b/template/src/main.rs index 22a27a218..f516ebc46 100644 --- a/template/src/main.rs +++ b/template/src/main.rs @@ -162,7 +162,7 @@ dylib-engine = ["fyrox/dylib"] base_path.join("game/src/lib.rs"), r#"//! Game project. use fyrox::{ - core::pool::Handle, core::visitor::prelude::*, + core::pool::Handle, core::visitor::prelude::*, core::reflect::prelude::*, event::Event, gui::message::UiMessage, plugin::{Plugin, PluginContext, PluginRegistrationContext}, @@ -173,7 +173,7 @@ use std::path::Path; // Re-export the engine. pub use fyrox; -#[derive(Default, Visit)] +#[derive(Default, Visit, Reflect)] pub struct Game { scene: Handle, }