mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '4.1' into 4.2-beta
This commit is contained in:
commit
1891d00025
2
.github/workflows/format-check.yml
vendored
2
.github/workflows/format-check.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
- name: Install OS dependencies (needed for act on ubuntu-latest)
|
- name: Install OS dependencies (needed for act on ubuntu-latest)
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y --force-yes curl xz-utils libicu-dev git dos2unix
|
sudo apt install -y --force-yes curl xz-utils libicu-dev git dos2unix libncurses5
|
||||||
|
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
|||||||
@ -286,7 +286,7 @@ float *spPathConstraint_computeWorldPositions(spPathConstraint *self, spPathAtta
|
|||||||
float *lengths = path->lengths;
|
float *lengths = path->lengths;
|
||||||
curveCount -= closed ? 1 : 2;
|
curveCount -= closed ? 1 : 2;
|
||||||
pathLength = lengths[curveCount];
|
pathLength = lengths[curveCount];
|
||||||
if (self->data->positionMode == SP_POSITION_MODE_PERCENT) position += pathLength;
|
if (self->data->positionMode == SP_POSITION_MODE_PERCENT) position *= pathLength;
|
||||||
switch (self->data->spacingMode) {
|
switch (self->data->spacingMode) {
|
||||||
case SP_SPACING_MODE_PERCENT:
|
case SP_SPACING_MODE_PERCENT:
|
||||||
multiplier = pathLength;
|
multiplier = pathLength;
|
||||||
|
|||||||
@ -106,7 +106,8 @@ static void toColor2(spColor *color, const char *value, int /*bool*/ hasAlpha) {
|
|||||||
color->g = toColor(value, 1);
|
color->g = toColor(value, 1);
|
||||||
color->b = toColor(value, 2);
|
color->b = toColor(value, 2);
|
||||||
if (hasAlpha) color->a = toColor(value, 3);
|
if (hasAlpha) color->a = toColor(value, 3);
|
||||||
else color->a =1.0f;
|
else
|
||||||
|
color->a = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@ -2,7 +2,7 @@ group = "com.esotericsoftware.spine"
|
|||||||
version = "4.1.0"
|
version = "4.1.0"
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
libgdxVersion = "1.10.1-SNAPSHOT"
|
libgdxVersion = "1.11.1-SNAPSHOT"
|
||||||
javaVersion = 8
|
javaVersion = 8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -305,7 +305,7 @@ export class SpineAtlasFile extends Phaser.Loader.MultiFile {
|
|||||||
} else {
|
} else {
|
||||||
file.data = {
|
file.data = {
|
||||||
data: file.data,
|
data: file.data,
|
||||||
premultipliedAlpha: this.premultipliedAlpha || file.data.indexOf("pma: true") >= 0
|
premultipliedAlpha: this.premultipliedAlpha || file.data.indexOf("pma: true") >= 0
|
||||||
};
|
};
|
||||||
file.addToCache();
|
file.addToCache();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,7 +86,7 @@ export class SceneRenderer implements Disposable {
|
|||||||
this.enableRenderer(this.batcher);
|
this.enableRenderer(this.batcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawSkeleton (skeleton: Skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform: VertexTransformer | null = null) {
|
drawSkeleton (skeleton: Skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform: VertexTransformer | null = null) {
|
||||||
this.enableRenderer(this.batcher);
|
this.enableRenderer(this.batcher);
|
||||||
this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;
|
this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;
|
||||||
this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform);
|
this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform);
|
||||||
|
|||||||
@ -51,6 +51,10 @@
|
|||||||
#define PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
|
#define PROBLEMATIC_PACKAGE_ASSET_MODIFICATION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if UNITY_2019_2_OR_NEWER
|
||||||
|
#define HAS_PACKAGE_INFO
|
||||||
|
#endif
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -114,6 +118,17 @@ namespace Spine.Unity.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool AssetCanBeModified (string assetPath) {
|
||||||
|
#if HAS_PACKAGE_INFO
|
||||||
|
UnityEditor.PackageManager.PackageInfo packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssetPath(assetPath);
|
||||||
|
return (packageInfo == null ||
|
||||||
|
packageInfo.source == UnityEditor.PackageManager.PackageSource.Embedded ||
|
||||||
|
packageInfo.source == UnityEditor.PackageManager.PackageSource.Local);
|
||||||
|
#else
|
||||||
|
return assetPath.StartsWith("Assets");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#region Match SkeletonData with Atlases
|
#region Match SkeletonData with Atlases
|
||||||
static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh };
|
static readonly AttachmentType[] AtlasTypes = { AttachmentType.Region, AttachmentType.Linkedmesh, AttachmentType.Mesh };
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,8 @@ namespace Spine.Unity.Editor {
|
|||||||
string[] prefabAssets = AssetDatabase.FindAssets("t:Prefab");
|
string[] prefabAssets = AssetDatabase.FindAssets("t:Prefab");
|
||||||
foreach (string asset in prefabAssets) {
|
foreach (string asset in prefabAssets) {
|
||||||
string assetPath = AssetDatabase.GUIDToAssetPath(asset);
|
string assetPath = AssetDatabase.GUIDToAssetPath(asset);
|
||||||
|
if (!AssetUtility.AssetCanBeModified(assetPath)) continue;
|
||||||
|
|
||||||
GameObject prefabGameObject = AssetDatabase.LoadAssetAtPath<GameObject>(assetPath);
|
GameObject prefabGameObject = AssetDatabase.LoadAssetAtPath<GameObject>(assetPath);
|
||||||
if (SpineEditorUtilities.CleanupSpinePrefabMesh(prefabGameObject)) {
|
if (SpineEditorUtilities.CleanupSpinePrefabMesh(prefabGameObject)) {
|
||||||
#if HAS_SAVE_ASSET_IF_DIRTY
|
#if HAS_SAVE_ASSET_IF_DIRTY
|
||||||
@ -139,6 +141,8 @@ namespace Spine.Unity.Editor {
|
|||||||
string[] spriteAtlasAssets = AssetDatabase.FindAssets("t:SpineSpriteAtlasAsset");
|
string[] spriteAtlasAssets = AssetDatabase.FindAssets("t:SpineSpriteAtlasAsset");
|
||||||
foreach (string asset in spriteAtlasAssets) {
|
foreach (string asset in spriteAtlasAssets) {
|
||||||
string assetPath = AssetDatabase.GUIDToAssetPath(asset);
|
string assetPath = AssetDatabase.GUIDToAssetPath(asset);
|
||||||
|
if (!AssetUtility.AssetCanBeModified(assetPath)) continue;
|
||||||
|
|
||||||
SpineSpriteAtlasAsset atlasAsset = AssetDatabase.LoadAssetAtPath<SpineSpriteAtlasAsset>(assetPath);
|
SpineSpriteAtlasAsset atlasAsset = AssetDatabase.LoadAssetAtPath<SpineSpriteAtlasAsset>(assetPath);
|
||||||
if (atlasAsset && atlasAsset.materials.Length > 0) {
|
if (atlasAsset && atlasAsset.materials.Length > 0) {
|
||||||
spriteAtlasTexturesToRestore[assetPath] = AssetDatabase.GetAssetPath(atlasAsset.materials[0].mainTexture);
|
spriteAtlasTexturesToRestore[assetPath] = AssetDatabase.GetAssetPath(atlasAsset.materials[0].mainTexture);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user