Browse Source

Merge branch '4.1' into 4.2-beta

Harald Csaszar 1 year ago
parent
commit
bba61a9a09

+ 3 - 1
spine-godot/spine_godot/SpineSprite.cpp

@@ -770,7 +770,7 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
 				mesh_instance->colors.set(j, Color(tint.r, tint.g, tint.b, tint.a));
 				mesh_instance->colors.set(j, Color(tint.r, tint.g, tint.b, tint.a));
 			}
 			}
 
 
-			auto indices_changed = true;
+			auto indices_changed = false;
 			if (mesh_instance->indices.size() == indices->size()) {
 			if (mesh_instance->indices.size() == indices->size()) {
 				auto old_indices = mesh_instance->indices.ptr();
 				auto old_indices = mesh_instance->indices.ptr();
 				auto new_indices = indices->buffer();
 				auto new_indices = indices->buffer();
@@ -780,6 +780,8 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
 						break;
 						break;
 					}
 					}
 				}
 				}
+			} else {
+				indices_changed = true;
 			}
 			}
 
 
 			if (indices_changed) {
 			if (indices_changed) {

+ 1 - 1
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Windows/SkeletonBaker.cs

@@ -46,7 +46,7 @@ namespace Spine.Unity.Editor {
 	/// [SUPPORTS]
 	/// [SUPPORTS]
 	/// Linear, Constant, and Bezier Curves*
 	/// Linear, Constant, and Bezier Curves*
 	/// Inverse Kinematics*
 	/// Inverse Kinematics*
-	/// Inherit Rotation
+	/// Disabled Inherit Rotation, unless combined with negative scale
 	/// Translate Timeline
 	/// Translate Timeline
 	/// Rotate Timeline
 	/// Rotate Timeline
 	/// Scale Timeline**
 	/// Scale Timeline**

+ 9 - 0
spine-unity/Modules/com.esotericsoftware.spine.addressables/Editor/AddressablesTextureLoaderInspector.cs

@@ -45,9 +45,18 @@ namespace Spine.Unity.Editor {
 	using PlaceholderMaterialMapping = AddressablesTextureLoader.PlaceholderMaterialMapping;
 	using PlaceholderMaterialMapping = AddressablesTextureLoader.PlaceholderMaterialMapping;
 	using PlaceholderTextureMapping = AddressablesTextureLoader.PlaceholderTextureMapping;
 	using PlaceholderTextureMapping = AddressablesTextureLoader.PlaceholderTextureMapping;
 
 
+	[InitializeOnLoad]
 	[CustomEditor(typeof(AddressablesTextureLoader)), CanEditMultipleObjects]
 	[CustomEditor(typeof(AddressablesTextureLoader)), CanEditMultipleObjects]
 	public class AddressablesTextureLoaderInspector : GenericTextureLoaderInspector {
 	public class AddressablesTextureLoaderInspector : GenericTextureLoaderInspector {
 
 
+		// Note: This static ctor ensures the generic base class method RegisterPlayModeChangedCallbacks is
+		// definitely called via InitializeOnLoad. Otherwise problems arose where the base class static ctor code
+		// is not executed (related to being a generic class).
+		static AddressablesTextureLoaderInspector () {
+			// The call below is necessary, otherwise the static GenericTextureLoaderInspector ctor is not called.
+			GenericTextureLoaderInspector.RegisterPlayModeChangedCallbacks();
+		}
+
 		public class AddressablesMethodImplementations : StaticMethodImplementations {
 		public class AddressablesMethodImplementations : StaticMethodImplementations {
 			public override string LoaderSuffix { get { return "_Addressable"; } }
 			public override string LoaderSuffix { get { return "_Addressable"; } }
 
 

+ 1 - 1
spine-unity/Modules/com.esotericsoftware.spine.addressables/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.addressables",
 	"name": "com.esotericsoftware.spine.addressables",
 	"displayName": "Spine Addressables Extensions [Experimental]",
 	"displayName": "Spine Addressables Extensions [Experimental]",
 	"description": "This experimental plugin provides integration of Addressables on-demand texture loading for the spine-unity runtime.\nPlease be sure to test this package first and create backups of your project before using.\n\nUsage: First declare your target Material textures as addressable. Then select the SpineAtlasAsset, right-click the SpineAtlasAsset Inspector heading and select 'Add Addressables Loader'. This generates an 'AddressableTextureLoader' asset providing configuration parameters and sets up low-resolution placeholder textures which are automatically assigned in a pre-build step when building your game executable.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime (via the spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
 	"description": "This experimental plugin provides integration of Addressables on-demand texture loading for the spine-unity runtime.\nPlease be sure to test this package first and create backups of your project before using.\n\nUsage: First declare your target Material textures as addressable. Then select the SpineAtlasAsset, right-click the SpineAtlasAsset Inspector heading and select 'Add Addressables Loader'. This generates an 'AddressableTextureLoader' asset providing configuration parameters and sets up low-resolution placeholder textures which are automatically assigned in a pre-build step when building your game executable.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime (via the spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
-	"version": "4.1.0-preview.2",
+	"version": "4.1.0-preview.3",
 	"unity": "2018.3",
 	"unity": "2018.3",
 	"author": {
 	"author": {
 		"name": "Esoteric Software",
 		"name": "Esoteric Software",

+ 6 - 0
spine-unity/Modules/com.esotericsoftware.spine.on-demand-loading/Editor/GenericOnDemandTextureLoaderInspector.cs

@@ -71,9 +71,15 @@ namespace Spine.Unity.Editor {
 		/// Called via InitializeOnLoad attribute upon Editor startup or compilation.
 		/// Called via InitializeOnLoad attribute upon Editor startup or compilation.
 		/// </summary>
 		/// </summary>
 		static GenericOnDemandTextureLoaderInspector () {
 		static GenericOnDemandTextureLoaderInspector () {
+			RegisterPlayModeChangedCallbacks();
+		}
+
+		public static void RegisterPlayModeChangedCallbacks () {
 #if NEWPLAYMODECALLBACKS
 #if NEWPLAYMODECALLBACKS
+			EditorApplication.playModeStateChanged -= OnPlaymodeChanged;
 			EditorApplication.playModeStateChanged += OnPlaymodeChanged;
 			EditorApplication.playModeStateChanged += OnPlaymodeChanged;
 #else
 #else
+			EditorApplication.playmodeStateChanged -= OnPlaymodeChanged;
 			EditorApplication.playmodeStateChanged += OnPlaymodeChanged;
 			EditorApplication.playmodeStateChanged += OnPlaymodeChanged;
 #endif
 #endif
 		}
 		}

+ 1 - 1
spine-unity/Modules/com.esotericsoftware.spine.on-demand-loading/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.on-demand-loading",
 	"name": "com.esotericsoftware.spine.on-demand-loading",
 	"displayName": "Spine On-Demand Loading Extensions [Experimental]",
 	"displayName": "Spine On-Demand Loading Extensions [Experimental]",
 	"description": "This experimental plugin provides a generic basic implementation of on-demand texture loading for the spine-unity runtime. You might want to use the available com.esotericsoftware.spine.addressables package which depends on this package.\nPlease be sure to test this package first and create backups of your project before using.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime (via the spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
 	"description": "This experimental plugin provides a generic basic implementation of on-demand texture loading for the spine-unity runtime. You might want to use the available com.esotericsoftware.spine.addressables package which depends on this package.\nPlease be sure to test this package first and create backups of your project before using.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime (via the spine-unity unitypackage), version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
-	"version": "4.1.0-preview.2",
+	"version": "4.1.0-preview.3",
 	"unity": "2018.3",
 	"unity": "2018.3",
 	"author": {
 	"author": {
 		"name": "Esoteric Software",
 		"name": "Esoteric Software",