Browse Source

[godot] Closes #2243, custom resource types returned incorrect values from get_resource_type().

Mario Zechner 2 năm trước cách đây
mục cha
commit
d9fff16b5f

+ 1 - 1
spine-godot/spine_godot/SpineAtlasResource.cpp

@@ -247,7 +247,7 @@ void SpineAtlasResourceFormatLoader::get_recognized_extensions(List<String> *ext
 }
 
 String SpineAtlasResourceFormatLoader::get_resource_type(const String &path) const {
-	return "SpineAtlasResource";
+	return path.ends_with("spatlas") || path.ends_with(".atlas") ? "SpineAtlasResource" : "";
 }
 
 bool SpineAtlasResourceFormatLoader::handles_type(const String &type) const {

+ 1 - 1
spine-godot/spine_godot/SpineSkeletonFileResource.cpp

@@ -174,7 +174,7 @@ void SpineSkeletonFileResourceFormatLoader::get_recognized_extensions(List<Strin
 }
 
 String SpineSkeletonFileResourceFormatLoader::get_resource_type(const String &path) const {
-	return "SpineSkeletonFileResource";
+	return path.ends_with(".spjson") || path.ends_with(".spskel") || path.ends_with(".spine-json") || path.ends_with(".skel") ? "SpineSkeletonFileResource" : "";
 }
 
 bool SpineSkeletonFileResourceFormatLoader::handles_type(const String &type) const {