File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -130,21 +130,15 @@ impl IResourceFormatSaver for MyAssetSaver {
130130 ) -> PackedStringArray {
131131 let mut array = PackedStringArray :: new ();
132132
133- // Even though the Godot docs state that you don't need this check, it is
134- // in fact necessary.
135- if Self :: is_recognized_resource (res ) {
136- // It is also possible to add multiple extensions per Saver.
137- array . push (" myextension" );
138- }
139-
133+ // It is also possible to add multiple extensions per Saver.
134+ array . push (" myextension" );
140135 array
141136 }
142137
143138 // All resource types that this saver should handle must return true.
144- fn is_recognized_resource ( res : Option <Gd <Resource >>) -> bool {
139+ fn recognize ( & self , res : Option <Gd <Resource >>) -> bool {
145140 // It is also possible to add multible resource types per Saver.
146- res . expect (" Godot called this without an input resource?" )
147- . is_class (" MyResourceType" )
141+ res . is_some_and (| r | r . is_class (" MyResourceType" ))
148142 }
149143
150144 // This defines your logic for actually saving your resource.
You can’t perform that action at this time.
0 commit comments