File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
bevy_mod_scripting_core/src/bindings/function
bevy_mod_scripting_functions/src Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,12 @@ impl<T> DerefMut for Val<T> {
166166 }
167167}
168168
169+ impl < T > From < T > for Val < T > {
170+ fn from ( value : T ) -> Self {
171+ Val ( value)
172+ }
173+ }
174+
169175impl < T : FromReflect > FromScript for Val < T > {
170176 type This < ' w > = Self ;
171177 fn from_script ( value : ScriptValue , world : WorldGuard ) -> Result < Self , InteropError > {
@@ -246,6 +252,12 @@ impl<T: FromReflect> FromScript for Ref<'_, T> {
246252 }
247253}
248254
255+ impl < ' a , T > From < & ' a T > for Ref < ' a , T > {
256+ fn from ( value : & ' a T ) -> Self {
257+ Ref ( value)
258+ }
259+ }
260+
249261/// A wrapper around a mutable reference to a value of type `T`.
250262///
251263/// This can be used to retrieve a mutable reference out of a [`ScriptValue::Reference`] corresponding to the type `T`.
@@ -269,6 +281,12 @@ impl<T> DerefMut for Mut<'_, T> {
269281 }
270282}
271283
284+ impl < ' a , T > From < & ' a mut T > for Mut < ' a , T > {
285+ fn from ( value : & ' a mut T ) -> Self {
286+ Mut ( value)
287+ }
288+ }
289+
272290impl < T : FromReflect > FromScript for Mut < ' _ , T > {
273291 type This < ' w > = Mut < ' w , T > ;
274292
Original file line number Diff line number Diff line change 11use :: bevy:: prelude:: * ;
22#[ cfg( feature = "core_functions" ) ]
3- pub mod bevy ;
3+ pub mod bevy_bindings ;
44#[ cfg( feature = "core_functions" ) ]
55pub mod core;
66
77pub mod namespaced_register;
88
9+ pub use core:: * ;
10+ pub use namespaced_register:: * ;
11+
912pub struct BevyFunctionsPlugin ;
1013
1114impl Plugin for BevyFunctionsPlugin {
You can’t perform that action at this time.
0 commit comments