@@ -6,7 +6,7 @@ pub enum ManageErrs {
6
6
RootClassNotSpatial ( String ) ,
7
7
}
8
8
9
- #[ derive( gdnative:: NativeClass ) ]
9
+ #[ derive( gdnative:: derive :: NativeClass ) ]
10
10
#[ inherit( Spatial ) ]
11
11
struct SceneCreate {
12
12
// Store the loaded scene for a very slight performance boost but mostly to show you how.
@@ -24,7 +24,7 @@ struct SceneCreate {
24
24
// Note, the same mechanism which is used to call from panel into spawn_one and remove_one can be
25
25
// used to call other GDNative classes here in rust.
26
26
27
- #[ gdnative:: methods]
27
+ #[ gdnative:: derive :: methods]
28
28
impl SceneCreate {
29
29
fn new ( _owner : & Spatial ) -> Self {
30
30
SceneCreate {
@@ -33,7 +33,7 @@ impl SceneCreate {
33
33
}
34
34
}
35
35
36
- #[ export]
36
+ #[ gdnative :: derive :: export]
37
37
fn _ready ( & mut self , _owner : & Spatial ) {
38
38
self . template = load_scene ( "res://Child_scene.tscn" ) ;
39
39
match & self . template {
@@ -42,7 +42,7 @@ impl SceneCreate {
42
42
}
43
43
}
44
44
45
- #[ export]
45
+ #[ gdnative :: derive :: export]
46
46
fn spawn_one ( & mut self , owner : & Spatial , message : GodotString ) {
47
47
godot_print ! ( "Called spawn_one({})" , message. to_string( ) ) ;
48
48
@@ -77,7 +77,7 @@ impl SceneCreate {
77
77
update_panel ( owner, num_children) ;
78
78
}
79
79
80
- #[ export]
80
+ #[ gdnative :: derive :: export]
81
81
fn remove_one ( & mut self , owner : & Spatial , str : GodotString ) {
82
82
godot_print ! ( "Called remove_one({})" , str ) ;
83
83
let num_children = owner. get_child_count ( ) ;
@@ -116,7 +116,7 @@ pub fn load_scene(path: &str) -> Option<Ref<PackedScene, ThreadLocal>> {
116
116
/// scene as the root. For instance Spatial is used for this example.
117
117
fn instance_scene < Root > ( scene : & PackedScene ) -> Result < Ref < Root , Unique > , ManageErrs >
118
118
where
119
- Root : gdnative:: GodotObject < RefKind = ManuallyManaged > + SubClass < Node > ,
119
+ Root : gdnative:: object :: GodotObject < RefKind = ManuallyManaged > + SubClass < Node > ,
120
120
{
121
121
let instance = scene
122
122
. instance ( PackedScene :: GEN_EDIT_STATE_DISABLED )
0 commit comments