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> {
166
166
}
167
167
}
168
168
169
+ impl < T > From < T > for Val < T > {
170
+ fn from ( value : T ) -> Self {
171
+ Val ( value)
172
+ }
173
+ }
174
+
169
175
impl < T : FromReflect > FromScript for Val < T > {
170
176
type This < ' w > = Self ;
171
177
fn from_script ( value : ScriptValue , world : WorldGuard ) -> Result < Self , InteropError > {
@@ -246,6 +252,12 @@ impl<T: FromReflect> FromScript for Ref<'_, T> {
246
252
}
247
253
}
248
254
255
+ impl < ' a , T > From < & ' a T > for Ref < ' a , T > {
256
+ fn from ( value : & ' a T ) -> Self {
257
+ Ref ( value)
258
+ }
259
+ }
260
+
249
261
/// A wrapper around a mutable reference to a value of type `T`.
250
262
///
251
263
/// 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> {
269
281
}
270
282
}
271
283
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
+
272
290
impl < T : FromReflect > FromScript for Mut < ' _ , T > {
273
291
type This < ' w > = Mut < ' w , T > ;
274
292
Original file line number Diff line number Diff line change 1
1
use :: bevy:: prelude:: * ;
2
2
#[ cfg( feature = "core_functions" ) ]
3
- pub mod bevy ;
3
+ pub mod bevy_bindings ;
4
4
#[ cfg( feature = "core_functions" ) ]
5
5
pub mod core;
6
6
7
7
pub mod namespaced_register;
8
8
9
+ pub use core:: * ;
10
+ pub use namespaced_register:: * ;
11
+
9
12
pub struct BevyFunctionsPlugin ;
10
13
11
14
impl Plugin for BevyFunctionsPlugin {
You can’t perform that action at this time.
0 commit comments