mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Merge branch '4.1' into 4.2-beta
# Conflicts: # spine-ts/package-lock.json # spine-ts/package.json # spine-ts/spine-canvas/package.json # spine-ts/spine-core/package.json # spine-ts/spine-player/package.json # spine-ts/spine-threejs/package.json # spine-ts/spine-webgl/package.json
This commit is contained in:
commit
d878e5356b
@ -195,7 +195,7 @@ export class SkeletonDebugRenderer implements Disposable {
|
|||||||
for (let i = 0, n = bones.length; i < n; i++) {
|
for (let i = 0, n = bones.length; i < n; i++) {
|
||||||
let bone = bones[i];
|
let bone = bones[i];
|
||||||
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;
|
if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;
|
||||||
shapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);
|
shapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, this.boneOriginColor, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -203,11 +203,35 @@ namespace Spine.Unity.Editor {
|
|||||||
var renderableAttachment = entry.Attachment as IHasTextureRegion;
|
var renderableAttachment = entry.Attachment as IHasTextureRegion;
|
||||||
if (renderableAttachment != null) {
|
if (renderableAttachment != null) {
|
||||||
var originalRegion = (AtlasRegion)renderableAttachment.Region;
|
var originalRegion = (AtlasRegion)renderableAttachment.Region;
|
||||||
Sequence sequence = null;
|
if (originalRegion != null) {
|
||||||
if (originalRegion == null && (sequence = renderableAttachment.Sequence) != null) {
|
anyCreationFailed |= CreateForRegion(
|
||||||
if (sequence.Regions != null && sequence.Regions.Length > 0)
|
ref replacementMaterials, ref anyReplacementMaterialsChanged,
|
||||||
originalRegion = (AtlasRegion)sequence.Regions[0];
|
originalRegion, materialTemplate, materialSuffix, skeletonDataAsset);
|
||||||
|
} else {
|
||||||
|
Sequence sequence = renderableAttachment.Sequence;
|
||||||
|
if (sequence != null && sequence.Regions != null) {
|
||||||
|
for (int i = 0, count = sequence.Regions.Length; i < count; ++i) {
|
||||||
|
originalRegion = (AtlasRegion)sequence.Regions[i];
|
||||||
|
anyCreationFailed |= CreateForRegion(
|
||||||
|
ref replacementMaterials, ref anyReplacementMaterialsChanged,
|
||||||
|
originalRegion, materialTemplate, materialSuffix, skeletonDataAsset);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
skeletonDataAsset.isUpgradingBlendModeMaterials = false;
|
||||||
|
EditorUtility.SetDirty(skeletonDataAsset);
|
||||||
|
return !anyCreationFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static bool CreateForRegion (ref List<BlendModeMaterials.ReplacementMaterial> replacementMaterials,
|
||||||
|
ref bool anyReplacementMaterialsChanged,
|
||||||
|
AtlasRegion originalRegion, Material materialTemplate, string materialSuffix,
|
||||||
|
SkeletonDataAsset skeletonDataAsset) {
|
||||||
|
|
||||||
|
bool anyCreationFailed = false;
|
||||||
bool replacementExists = replacementMaterials.Exists(
|
bool replacementExists = replacementMaterials.Exists(
|
||||||
replacement => replacement.pageName == originalRegion.page.name);
|
replacement => replacement.pageName == originalRegion.page.name);
|
||||||
if (!replacementExists) {
|
if (!replacementExists) {
|
||||||
@ -228,13 +252,7 @@ namespace Spine.Unity.Editor {
|
|||||||
anyCreationFailed = true;
|
anyCreationFailed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return anyCreationFailed;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
skeletonDataAsset.isUpgradingBlendModeMaterials = false;
|
|
||||||
EditorUtility.SetDirty(skeletonDataAsset);
|
|
||||||
return !anyCreationFailed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static string GetBlendModeMaterialPath (AtlasPage originalPage, string materialSuffix) {
|
protected static string GetBlendModeMaterialPath (AtlasPage originalPage, string materialSuffix) {
|
||||||
|
|||||||
@ -96,7 +96,12 @@ namespace Spine.Unity {
|
|||||||
"\nWarning: 'Canvas Group Tint Black' is enabled at SkeletonGraphic but not 'CanvasGroup Compatible' at the Material!\n\nPlease\n"
|
"\nWarning: 'Canvas Group Tint Black' is enabled at SkeletonGraphic but not 'CanvasGroup Compatible' at the Material!\n\nPlease\n"
|
||||||
+ "a) enable 'CanvasGroup Compatible' at the Material or\n"
|
+ "a) enable 'CanvasGroup Compatible' at the Material or\n"
|
||||||
+ "b) disable 'Canvas Group Tint Black' at the SkeletonGraphic component under 'Advanced'.\n"
|
+ "b) disable 'Canvas Group Tint Black' at the SkeletonGraphic component under 'Advanced'.\n"
|
||||||
+ "You may want to duplicate the 'SkeletonGraphicDefault' material and change settings at the duplicate to not affect all instances.";
|
+ "You may want to duplicate the 'SkeletonGraphicTintBlack' material and change settings at the duplicate to not affect all instances.";
|
||||||
|
public static readonly string kCanvasGroupCompatibleDisabledMessage =
|
||||||
|
"\nWarning: 'CanvasGroup Compatible' is enabled at the Material but 'Canvas Group Tint Black' is disabled at SkeletonGraphic!\n\nPlease\n"
|
||||||
|
+ "a) disable 'CanvasGroup Compatible' at the Material or\n"
|
||||||
|
+ "b) enable 'Canvas Group Tint Black' at the SkeletonGraphic component under 'Advanced'.\n"
|
||||||
|
+ "You may want to duplicate the 'SkeletonGraphicTintBlack' material and change settings at the duplicate to not affect all instances.";
|
||||||
|
|
||||||
public static bool IsMaterialSetupProblematic (SkeletonRenderer renderer, ref string errorMessage) {
|
public static bool IsMaterialSetupProblematic (SkeletonRenderer renderer, ref string errorMessage) {
|
||||||
var materials = renderer.GetComponent<Renderer>().sharedMaterials;
|
var materials = renderer.GetComponent<Renderer>().sharedMaterials;
|
||||||
@ -152,6 +157,11 @@ namespace Spine.Unity {
|
|||||||
isProblematic = true;
|
isProblematic = true;
|
||||||
errorMessage += kCanvasGroupCompatibleMessage;
|
errorMessage += kCanvasGroupCompatibleMessage;
|
||||||
}
|
}
|
||||||
|
if (settings.tintBlack == true && settings.canvasGroupTintBlack == false
|
||||||
|
&& IsCanvasGroupCompatible(material)) {
|
||||||
|
isProblematic = true;
|
||||||
|
errorMessage += kCanvasGroupCompatibleDisabledMessage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return isProblematic;
|
return isProblematic;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user