@@ -6,31 +6,40 @@ use super::bevy_ecs::*;
66use super :: bevy_reflect:: * ;
77use super :: bevy_core:: * ;
88use bevy_mod_scripting_core:: {
9- AddContextInitializer , StoreDocumentation , bindings:: ReflectReference ,
9+ AddContextInitializer , StoreDocumentation ,
10+ bindings:: { ReflectReference , function:: from:: { Ref , Mut , Val } } ,
1011} ;
1112use bevy_mod_scripting_functions:: RegisterScriptFunction ;
1213use crate :: * ;
1314pub struct BevyHierarchyScriptingPlugin ;
1415impl bevy:: app:: Plugin for BevyHierarchyScriptingPlugin {
1516 fn build ( & self , app : & mut bevy:: prelude:: App ) {
1617 let mut world = app. world_mut ( ) ;
17- NamespaceBuilder :: < Children > :: new ( world)
18+ NamespaceBuilder :: < bevy :: hierarchy :: prelude :: Children > :: new ( world)
1819 . overwrite_script_function (
1920 "swap" ,
2021 |
2122 _self : Mut < bevy:: hierarchy:: prelude:: Children > ,
2223 a_index : usize ,
2324 b_index : usize |
2425 {
25- let output: ( ) = Children :: swap ( _self, a_index, b_index) . into ( ) ;
26+ let output: ( ) = bevy:: hierarchy:: prelude:: Children :: swap (
27+ _self,
28+ a_index,
29+ b_index,
30+ )
31+ . into ( ) ;
2632 output
2733 } ,
2834 ) ;
29- NamespaceBuilder :: < Parent > :: new ( world)
35+ NamespaceBuilder :: < bevy :: hierarchy :: prelude :: Parent > :: new ( world)
3036 . overwrite_script_function (
3137 "assert_receiver_is_total_eq" ,
3238 |_self : Ref < bevy:: hierarchy:: prelude:: Parent > | {
33- let output: ( ) = Parent :: assert_receiver_is_total_eq ( _self) . into ( ) ;
39+ let output: ( ) = bevy:: hierarchy:: prelude:: Parent :: assert_receiver_is_total_eq (
40+ _self,
41+ )
42+ . into ( ) ;
3443 output
3544 } ,
3645 )
@@ -40,15 +49,16 @@ impl bevy::app::Plugin for BevyHierarchyScriptingPlugin {
4049 _self : Ref < bevy:: hierarchy:: prelude:: Parent > ,
4150 other : Ref < bevy:: hierarchy:: prelude:: Parent > |
4251 {
43- let output: bool = Parent :: eq ( _self, other) . into ( ) ;
52+ let output: bool = bevy:: hierarchy:: prelude:: Parent :: eq ( _self, other)
53+ . into ( ) ;
4454 output
4555 } ,
4656 ) ;
47- NamespaceBuilder :: < HierarchyEvent > :: new ( world)
57+ NamespaceBuilder :: < bevy :: hierarchy :: HierarchyEvent > :: new ( world)
4858 . overwrite_script_function (
4959 "clone" ,
5060 |_self : Ref < bevy:: hierarchy:: HierarchyEvent > | {
51- let output: Val < bevy:: hierarchy:: HierarchyEvent > = HierarchyEvent :: clone (
61+ let output: Val < bevy:: hierarchy:: HierarchyEvent > = bevy :: hierarchy :: HierarchyEvent :: clone (
5262 _self,
5363 )
5464 . into ( ) ;
@@ -61,14 +71,17 @@ impl bevy::app::Plugin for BevyHierarchyScriptingPlugin {
6171 _self : Ref < bevy:: hierarchy:: HierarchyEvent > ,
6272 other : Ref < bevy:: hierarchy:: HierarchyEvent > |
6373 {
64- let output: bool = HierarchyEvent :: eq ( _self, other) . into ( ) ;
74+ let output: bool = bevy:: hierarchy:: HierarchyEvent :: eq ( _self, other)
75+ . into ( ) ;
6576 output
6677 } ,
6778 )
6879 . overwrite_script_function (
6980 "assert_receiver_is_total_eq" ,
7081 |_self : Ref < bevy:: hierarchy:: HierarchyEvent > | {
71- let output: ( ) = HierarchyEvent :: assert_receiver_is_total_eq ( _self)
82+ let output: ( ) = bevy:: hierarchy:: HierarchyEvent :: assert_receiver_is_total_eq (
83+ _self,
84+ )
7285 . into ( ) ;
7386 output
7487 } ,
0 commit comments