From 599071028b90a34f3dbcbc26c09e8b3bd6abc051 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Sun, 16 Jun 2019 22:26:18 +0200 Subject: [PATCH 01/11] [unity] Fixed a crash related to importing and stencil mode auto-updater. --- .../Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs index 307ffd8c9..1051f16cd 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs @@ -480,7 +480,7 @@ namespace Spine.Unity { private void AssignSpriteMaskMaterials() { #if UNITY_EDITOR - if (!Application.isPlaying) { + if (!Application.isPlaying && !UnityEditor.EditorApplication.isUpdating) { EditorFixStencilCompParameters(); } #endif From 72b186d8477c7c3ab04f35a624990b1a500882be Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 17 Jun 2019 17:53:28 +0200 Subject: [PATCH 02/11] [unity] Corrected .gitignore file for unity-csharp subdir, it still referenced the old directory structure. --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 367244d66..5bebb0b50 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,11 @@ spine-xna/.vs/ spine-unity/Assets/spine-csharp* !spine-unity/Assets/spine-csharp/Place spine-csharp src here.* +!spine-unity/Assets/spine-csharp/add spine-csharp src here.* +spine-unity/Assets/Spine/Runtime/spine-csharp* +!spine-unity/Assets/Spine/Runtime/spine-csharp/add spine-csharp here.txt.meta +spine-unity/spine-unity.Editor.csproj +spine-unity/spine-unity.csproj spine-unity/spine-unity.CSharp.csproj spine-unity/spine-unity.CSharp.Editor.csproj spine-unity/ProjectSettings From 61cb900c744569e57654b8d8354a24f98aa150f4 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 17 Jun 2019 18:07:03 +0200 Subject: [PATCH 03/11] [unity] Added a spine-unity tests subdir to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5bebb0b50..96ebd26dc 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,7 @@ spine-unity/obj Assembly-*.csproj Assembly-*.pidb AssetStoreTools* +spine-unity/Assets/Tests/ spine-tk2d/Assets/spine-csharp* !spine-tk2d/Assets/spine-csharp/Place spine-csharp src here.* From 7c3cb7b196eeeba06f208179ada61a3ea5649efc Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 17 Jun 2019 18:10:43 +0200 Subject: [PATCH 04/11] [unity] gitignore - minor update. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 96ebd26dc..f635f8318 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,8 @@ spine-unity/Assets/spine-csharp* !spine-unity/Assets/spine-csharp/add spine-csharp src here.* spine-unity/Assets/Spine/Runtime/spine-csharp* !spine-unity/Assets/Spine/Runtime/spine-csharp/add spine-csharp here.txt.meta +spine-unity/Assets/Tests/ +spine-unity/Assets/Tests.meta spine-unity/spine-unity.Editor.csproj spine-unity/spine-unity.csproj spine-unity/spine-unity.CSharp.csproj @@ -82,7 +84,6 @@ spine-unity/obj Assembly-*.csproj Assembly-*.pidb AssetStoreTools* -spine-unity/Assets/Tests/ spine-tk2d/Assets/spine-csharp* !spine-tk2d/Assets/spine-csharp/Place spine-csharp src here.* From 57992b6cdf01c40c08e8759341f7e940e95ce89b Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 19 Jun 2019 15:02:35 +0200 Subject: [PATCH 05/11] [unity] Fixed unnecessary correct-material-stencil-comp and save assets calls which caused wait time after exiting play mode. Closes #1385. --- .../Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs index 1051f16cd..cc3d934aa 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs @@ -567,7 +567,7 @@ namespace Spine.Unity { return true; } } - return true; + return false; } #endif // UNITY_EDITOR From ee61fe3b8f012f3d23ee0aa0f8e003183ae79f9d Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 25 Jun 2019 16:40:33 +0200 Subject: [PATCH 06/11] [unity] updated 3.7 CHANGELOG with one minor entry. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68c372561..0bf15243e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -163,6 +163,7 @@ This will automatically: 1. download the Unity Timeline package 2. activate the Spine Timeline components by setting the compile definition `SPINE_TIMELINE_PACKAGE_DOWNLOADED` for all platforms 3. modify the `spine-unity.asmdef` file by adding the reference to the Unity Timeline library. +* Added `Create 2D Hinge Chain` functionality at `SkeletonUtilityBone` inspector, previously only `Create 3D Hinge Chain` was available. ### XNA/MonoGame * Added support for any `Effect` to be used by `SkeletonRenderer` From 2a361cd46d2ddbf30a373337286d6abda37f6498 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 8 Jul 2019 16:30:33 +0200 Subject: [PATCH 07/11] [unity] Changed default sRGBTexture attribute at spine atlas texture import back to true. This creates consistent and correct look in linear and gamma color space which is more important than rare mipmap problems. The potential problem of incorrectly generated mipmaps at pma textures will be reported by warning message, no longer prevented via default settings. --- .../Spine Skeletons/spineboy-unity/spineboy.png.meta | 4 ++-- .../Editor/spine-unity/Editor/SpineEditorUtilities.cs | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-unity/spineboy.png.meta b/spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-unity/spineboy.png.meta index f42b5dfc6..12efdb0f7 100644 --- a/spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-unity/spineboy.png.meta +++ b/spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-unity/spineboy.png.meta @@ -34,8 +34,8 @@ TextureImporter: serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 0 + enableMipMap: 0 + sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs index 709254936..21d1871d8 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs @@ -286,8 +286,8 @@ namespace Spine.Unity.Editor { // 'sRGBTexture = true' generates incorrectly weighted mipmaps at PMA textures, // causing white borders due to undesired custom weighting. - if (texImporter.sRGBTexture && texImporter.mipmapEnabled) { - Debug.LogWarningFormat("`{0}` : Incorrect Texture Settings found: When enabling `Generate Mip Maps`, it is strongly recommended to disable `sRGB (Color Texture)`. Otherwise you will receive white border artifacts on an atlas exported with default `Premultiply alpha` settings.\n(You can disable this warning in `Edit - Preferences - Spine`)", texturePath); + if (texImporter.sRGBTexture && texImporter.mipmapEnabled && PlayerSettings.colorSpace == ColorSpace.Gamma) { + Debug.LogWarningFormat("`{0}` : Problematic Texture Settings found: When enabling `Generate Mip Maps` in Gamma color space, it is recommended to disable `sRGB (Color Texture)`. Otherwise you will receive white border artifacts on an atlas exported with default `Premultiply alpha` settings.\n(You can disable this warning in `Edit - Preferences - Spine`)", texturePath); } if (texImporter.alphaIsTransparency) { int straightAlphaValue = material.GetInt(STRAIGHT_ALPHA_PARAM_ID); @@ -966,10 +966,6 @@ namespace Spine.Unity.Editor { continue; } - // Note: 'sRGBTexture = false' below might seem counter-intuitive, but prevents mipmaps from being - // generated incorrectly (causing white borders due to undesired custom weighting) for PMA textures - // when mipmaps are enabled later. - texImporter.sRGBTexture = false; texImporter.textureCompression = TextureImporterCompression.Uncompressed; texImporter.alphaSource = TextureImporterAlphaSource.FromInput; texImporter.mipmapEnabled = false; From 5b0d446b1f829df40d4d91de2a25904c294a8ade Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Tue, 9 Jul 2019 00:07:41 +0200 Subject: [PATCH 08/11] [spine-player] Tabs, not spaces. --- spine-ts/player/css/spine-player.css | 40 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/spine-ts/player/css/spine-player.css b/spine-ts/player/css/spine-player.css index 736515f1a..7f890e3a8 100644 --- a/spine-ts/player/css/spine-player.css +++ b/spine-ts/player/css/spine-player.css @@ -12,11 +12,11 @@ font-family: "PT Sans",Arial,"Helvetica Neue",Helvetica,Tahoma,sans-serif; color: #dddddd; -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .spine-player-error { @@ -55,13 +55,13 @@ } .spine-player-slider:hover .spine-player-slider-value { - height: 4px; + height: 4px; background: rgba(98, 176, 238, 1); transition: height 0.2s; } .spine-player-slider-value.hovering { - height: 4px; + height: 4px; background: rgba(98, 176, 238, 1); transition: height 0.2s; } @@ -194,11 +194,11 @@ .spine-player-popup { user-select: none; - position: absolute; - background: rgba(0, 0, 0, 0.75); - z-index: 1; + position: absolute; + background: rgba(0, 0, 0, 0.75); + z-index: 1; right: 2px; - bottom: 40px; + bottom: 40px; border-radius: 4px; max-height: 400%; overflow: auto; @@ -206,8 +206,8 @@ } .spine-player-popup-title { - margin: 4px 15px 2px 15px; - text-align: center; + margin: 4px 15px 2px 15px; + text-align: center; } .spine-player-popup hr { @@ -260,8 +260,8 @@ width: 32px; height: 32px; background-size: 20px; - background-repeat: no-repeat; - background-position: center; + background-repeat: no-repeat; + background-position: center; cursor: pointer; margin-right: 3px; padding-bottom: 3px; @@ -362,11 +362,11 @@ .spine-player-button-icon-spine-logo { height: 20px; - position: relative; + position: relative; top: 1px; - margin: 0 8px !important; - align-self: center; - border: none !important; + margin: 0 8px !important; + align-self: center; + border: none !important; width: auto !important; cursor: pointer; transition: transform 0.2s; @@ -405,4 +405,4 @@ flex: 1; border: none; background: black; -} \ No newline at end of file +} From 8532d3a929d2d49225681604e539d4dcdbb13e48 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 10 Jul 2019 11:56:30 +0200 Subject: [PATCH 09/11] [unity] for 3.7 branch only: added a non-behaviour changing implementation of SettingsProvider for Unity 2018.3+. In case of merge conflicts to 3.8-beta branch discard this commit's changes, 3.8 already contains a full-fledged SettingsProvider implementation. Closes #1405 --- .../Editor/SpineEditorUtilities.cs | 82 ++++++++++++------- 1 file changed, 54 insertions(+), 28 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs index 21d1871d8..f5848e43c 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs @@ -46,6 +46,10 @@ #define NEWHIERARCHYWINDOWCALLBACKS #endif +#if UNITY_2018_3_OR_NEWER +#define NEW_PREFERENCES_SETTINGS_PROVIDER +#endif + #if UNITY_2019_1_OR_NEWER #define NEW_TIMELINE_AS_PACKAGE #endif @@ -174,11 +178,33 @@ namespace Spine.Unity.Editor { static int STRAIGHT_ALPHA_PARAM_ID = Shader.PropertyToID("_StraightAlphaInput"); + #if NEW_PREFERENCES_SETTINGS_PROVIDER + static class SpineSettingsProviderRegistration + { + [SettingsProvider] + public static SettingsProvider CreateSpineSettingsProvider() + { + var provider = new SettingsProvider("Spine", SettingsScope.User) + { + label = "Spine", + guiHandler = (searchContext) => + { + Preferences.HandlePreferencesGUI(); // This line shall NOT be merged to 3.8 branch. Version to provide a non-behavior-changing implementation for 3.7 branch. + }, + + // Populate the search keywords to enable smart search filtering and label highlighting: + keywords = new HashSet(new[] { "Spine", "Preferences", "Skeleton", "Default", "Mix", "Duration" }) + }; + return provider; + } + } + #else // Preferences entry point [PreferenceItem("Spine")] static void PreferencesGUI () { Preferences.HandlePreferencesGUI(); } + #endif // Auto-import entry point static void OnPostprocessAllAssets (string[] imported, string[] deleted, string[] moved, string[] movedFromAssetPaths) { @@ -206,39 +232,39 @@ namespace Spine.Unity.Editor { Icons.Initialize(); // Drag and Drop - #if UNITY_2019_1_OR_NEWER +#if UNITY_2019_1_OR_NEWER SceneView.duringSceneGui -= DragAndDropInstantiation.SceneViewDragAndDrop; SceneView.duringSceneGui += DragAndDropInstantiation.SceneViewDragAndDrop; - #else +#else SceneView.onSceneGUIDelegate -= DragAndDropInstantiation.SceneViewDragAndDrop; SceneView.onSceneGUIDelegate += DragAndDropInstantiation.SceneViewDragAndDrop; - #endif +#endif EditorApplication.hierarchyWindowItemOnGUI -= HierarchyHandler.HandleDragAndDrop; EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop; // Hierarchy Icons - #if NEWPLAYMODECALLBACKS +#if NEWPLAYMODECALLBACKS EditorApplication.playModeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged; EditorApplication.playModeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged; HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); - #else +#else EditorApplication.playmodeStateChanged -= HierarchyHandler.IconsOnPlaymodeStateChanged; EditorApplication.playmodeStateChanged += HierarchyHandler.IconsOnPlaymodeStateChanged; HierarchyHandler.IconsOnPlaymodeStateChanged(); - #endif +#endif // Data Refresh Edit Mode. // This prevents deserialized SkeletonData from persisting from play mode to edit mode. - #if NEWPLAYMODECALLBACKS +#if NEWPLAYMODECALLBACKS EditorApplication.playModeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged; EditorApplication.playModeStateChanged += DataReloadHandler.OnPlaymodeStateChanged; DataReloadHandler.OnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); - #else +#else EditorApplication.playmodeStateChanged -= DataReloadHandler.OnPlaymodeStateChanged; EditorApplication.playmodeStateChanged += DataReloadHandler.OnPlaymodeStateChanged; DataReloadHandler.OnPlaymodeStateChanged(); - #endif +#endif if (SpineEditorUtilities.Preferences.textureImporterWarning) { IssueWarningsForUnrecommendedTextureSettings(); @@ -298,14 +324,14 @@ namespace Spine.Unity.Editor { } return true; } - #endregion +#endregion public static class Preferences { - #if SPINE_TK2D +#if SPINE_TK2D const float DEFAULT_DEFAULT_SCALE = 1f; - #else +#else const float DEFAULT_DEFAULT_SCALE = 0.01f; - #endif +#endif const string DEFAULT_SCALE_KEY = "SPINE_DEFAULT_SCALE"; public static float defaultScale = DEFAULT_DEFAULT_SCALE; @@ -378,11 +404,11 @@ namespace Spine.Unity.Editor { showHierarchyIcons = EditorGUILayout.Toggle(new GUIContent("Show Hierarchy Icons", "Show relevant icons on GameObjects with Spine Components on them. Disable this if you have large, complex scenes."), showHierarchyIcons); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetBool(SHOW_HIERARCHY_ICONS_KEY, showHierarchyIcons); - #if NEWPLAYMODECALLBACKS +#if NEWPLAYMODECALLBACKS HierarchyHandler.IconsOnPlaymodeStateChanged(PlayModeStateChange.EnteredEditMode); - #else +#else HierarchyHandler.IconsOnPlaymodeStateChanged(); - #endif +#endif } BoolPrefsField(ref autoReloadSceneSkeletons, AUTO_RELOAD_SCENESKELETONS_KEY, new GUIContent("Auto-reload scene components", "Reloads Skeleton components in the scene whenever their SkeletonDataAsset is modified. This makes it so changes in the SkeletonDataAsset inspector are immediately reflected. This may be slow when your scenes have large numbers of SkeletonRenderers or SkeletonGraphic.")); @@ -432,7 +458,7 @@ namespace Spine.Unity.Editor { } } - #if NEW_TIMELINE_AS_PACKAGE +#if NEW_TIMELINE_AS_PACKAGE GUILayout.Space(20); EditorGUILayout.LabelField("Timeline Support", EditorStyles.boldLabel); using (new GUILayout.HorizontalScope()) { @@ -446,7 +472,7 @@ namespace Spine.Unity.Editor { SpineEditorUtilities.SpinePackageDependencyUtility.DisableTimelineSupport(); } } - #endif +#endif GUILayout.Space(20); EditorGUILayout.LabelField("3rd Party Settings", EditorStyles.boldLabel); @@ -1459,20 +1485,20 @@ namespace Spine.Unity.Editor { /// Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable. public static GameObject NewGameObject (string name) { - #if NEW_PREFAB_SYSTEM +#if NEW_PREFAB_SYSTEM return ObjectFactory.CreateGameObject(name); - #else +#else return new GameObject(name); - #endif +#endif } /// Handles creating a new GameObject in the Unity Editor. This uses the new ObjectFactory API where applicable. public static GameObject NewGameObject (string name, params System.Type[] components) { - #if NEW_PREFAB_SYSTEM +#if NEW_PREFAB_SYSTEM return ObjectFactory.CreateGameObject(name, components); - #else +#else return new GameObject(name, components); - #endif +#endif } public static void InstantiateEmptySpineGameObject (string name) where T : MonoBehaviour { @@ -1824,7 +1850,7 @@ namespace Spine.Unity.Editor { Failure } - #if NEW_TIMELINE_AS_PACKAGE +#if NEW_TIMELINE_AS_PACKAGE const string SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE = "SPINE_TIMELINE_PACKAGE_DOWNLOADED"; const string TIMELINE_PACKAGE_NAME = "com.unity.timeline"; const string TIMELINE_ASMDEF_DEPENDENCY_STRING = "\"Unity.Timeline\""; @@ -1877,9 +1903,9 @@ namespace Spine.Unity.Editor { internal static void HandleSuccessfulTimelinePackageDownload () { - #if !SPINE_TK2D +#if !SPINE_TK2D SpineBuildEnvUtility.EnableSpineAsmdefFiles(); - #endif +#endif SpineBuildEnvUtility.AddDependencyToAsmdefFile(TIMELINE_ASMDEF_DEPENDENCY_STRING); SpineBuildEnvUtility.EnableBuildDefine(SPINE_TIMELINE_PACKAGE_DOWNLOADED_DEFINE); @@ -1911,7 +1937,7 @@ namespace Spine.Unity.Editor { } } } - #endif +#endif } } From a96a059faf190110bc83a8a1b56a0dbc37787f60 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 10 Jul 2019 12:38:21 +0200 Subject: [PATCH 10/11] [unity] Fixed fragment shader output (from COLOR to SV_Target), fixes ps4 shader compile error. Closes #1374. --- .../Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader | 2 +- .../Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc | 2 +- .../spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc | 2 +- .../Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader | 4 ++-- .../Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader | 2 +- .../Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader | 4 ++-- .../spine-unity/Shaders/Spine-Skeleton-TintBlack.shader | 4 ++-- .../Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader | 4 ++-- .../Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader index b11723950..2dc66e519 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader @@ -101,7 +101,7 @@ Shader "Spine/Special/Skeleton Grayscale" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc index a24df47e3..478f26bd2 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc @@ -38,7 +38,7 @@ vertexOutput vert(vertexInput v) uniform fixed _ShadowAlphaCutoff; -fixed4 frag(vertexOutput IN) : COLOR +fixed4 frag(vertexOutput IN) : SV_Target { fixed4 texureColor = calculateTexturePixel(IN.texcoord); clip(texureColor.a - _ShadowAlphaCutoff); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc index 6b88c198f..95fb7b8d8 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc @@ -41,7 +41,7 @@ vertexOutput vert(vertexInput v) uniform fixed _ShadowAlphaCutoff; -fixed4 frag(vertexOutput IN) : COLOR +fixed4 frag(vertexOutput IN) : SV_Target { fixed4 texureColor = tex2D(_MainTex, IN.texcoord.xy); clip(texureColor.a - _ShadowAlphaCutoff); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader index 1b270f25d..779b2a21f 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader @@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -103,7 +103,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" { uniform sampler2D _MainTex; uniform fixed _Cutoff; - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader index 18b4d7c4b..0e4e61de6 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader @@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Multiply" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader index dab802255..54efdb440 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader @@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -103,7 +103,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" { uniform sampler2D _MainTex; uniform fixed _Cutoff; - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader index de1262f5b..d5870249e 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader @@ -69,7 +69,7 @@ Shader "Spine/Skeleton Tint Black" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -110,7 +110,7 @@ Shader "Spine/Skeleton Tint Black" { return o; } - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader index 308420be4..e75e44a09 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader @@ -50,7 +50,7 @@ Shader "Spine/Skeleton" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { float4 texColor = tex2D(_MainTex, i.uv); #if defined(_STRAIGHT_ALPHA_INPUT) @@ -94,7 +94,7 @@ Shader "Spine/Skeleton" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader index cac6036d8..2041c8199 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader @@ -194,7 +194,7 @@ Shader "Spine/Skeleton Lit" { uniform sampler2D _MainTex; uniform fixed _Cutoff; - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) From 3432d16374e3c857b33462f2793a4bc40d04d60c Mon Sep 17 00:00:00 2001 From: badlogic Date: Thu, 11 Jul 2019 14:24:41 +0200 Subject: [PATCH 11/11] [cocos2dx] Closes #1406, set renderer object on track entry to NULL after track entry disposal. --- spine-cocos2dx/src/spine/SkeletonAnimation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spine-cocos2dx/src/spine/SkeletonAnimation.cpp b/spine-cocos2dx/src/spine/SkeletonAnimation.cpp index 36dca2876..9b0444eaf 100644 --- a/spine-cocos2dx/src/spine/SkeletonAnimation.cpp +++ b/spine-cocos2dx/src/spine/SkeletonAnimation.cpp @@ -55,7 +55,10 @@ void animationCallback (AnimationState* state, EventType type, TrackEntry* entry void trackEntryCallback (AnimationState* state, EventType type, TrackEntry* entry, Event* event) { ((SkeletonAnimation*)state->getRendererObject())->onTrackEntryEvent(entry, type, event); if (type == EventType_Dispose) - if (entry->getRendererObject()) delete (spine::_TrackEntryListeners*)entry->getRendererObject(); + if (entry->getRendererObject()) { + delete (spine::_TrackEntryListeners*)entry->getRendererObject(); + entry->setRendererObject(NULL); + } } static _TrackEntryListeners* getListeners (TrackEntry* entry) {