Merge branch '3.8' into 3.9-beta

This commit is contained in:
badlogic 2019-11-15 12:57:48 +01:00
commit f956dc4bfc
17 changed files with 79 additions and 33 deletions

View File

@ -6147,7 +6147,7 @@ var spine;
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
};
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
if (!map.curve)
if (!map.hasOwnProperty("curve"))
return;
if (map.curve == "stepped")
timeline.setStepped(frameIndex);

File diff suppressed because one or more lines are too long

View File

@ -6147,7 +6147,7 @@ var spine;
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
};
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
if (!map.curve)
if (!map.hasOwnProperty("curve"))
return;
if (map.curve == "stepped")
timeline.setStepped(frameIndex);

File diff suppressed because one or more lines are too long

View File

@ -6147,7 +6147,7 @@ var spine;
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
};
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
if (!map.curve)
if (!map.hasOwnProperty("curve"))
return;
if (map.curve == "stepped")
timeline.setStepped(frameIndex);

File diff suppressed because one or more lines are too long

View File

@ -6147,7 +6147,7 @@ var spine;
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
};
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
if (!map.curve)
if (!map.hasOwnProperty("curve"))
return;
if (map.curve == "stepped")
timeline.setStepped(frameIndex);

File diff suppressed because one or more lines are too long

View File

@ -6147,7 +6147,7 @@ var spine;
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
};
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
if (!map.curve)
if (!map.hasOwnProperty("curve"))
return;
if (map.curve == "stepped")
timeline.setStepped(frameIndex);

File diff suppressed because one or more lines are too long

View File

@ -6147,7 +6147,7 @@ var spine;
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
};
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
if (!map.curve)
if (!map.hasOwnProperty("curve"))
return;
if (map.curve == "stepped")
timeline.setStepped(frameIndex);

File diff suppressed because one or more lines are too long

View File

@ -784,7 +784,7 @@ module spine {
}
readCurve (map: any, timeline: CurveTimeline, frameIndex: number) {
if (!map.curve) return;
if (!map.hasOwnProperty("curve")) return;
if (map.curve == "stepped")
timeline.setStepped(frameIndex);
else {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -117,6 +117,14 @@ namespace Spine.Unity {
[System.Serializable]
public class SpriteMaskInteractionMaterials {
public bool AnyMaterialCreated {
get {
return materialsMaskDisabled.Length > 0 ||
materialsInsideMask.Length > 0 ||
materialsOutsideMask.Length > 0;
}
}
/// <summary>Material references for switching material sets at runtime when <see cref="SkeletonRenderer.maskInteraction"/> changes to <see cref="SpriteMaskInteraction.None"/>.</summary>
public Material[] materialsMaskDisabled = new Material[0];
/// <summary>Material references for switching material sets at runtime when <see cref="SkeletonRenderer.maskInteraction"/> changes to <see cref="SpriteMaskInteraction.VisibleInsideMask"/>.</summary>
@ -417,12 +425,16 @@ namespace Spine.Unity {
rendererBuffers.UpdateSharedMaterials(workingSubmeshInstructions);
bool materialsChanged = rendererBuffers.MaterialsChangedInLastUpdate();
if (updateTriangles) { // Check if the triangles should also be updated.
meshGenerator.FillTriangles(currentMesh);
meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray();
} else if (rendererBuffers.MaterialsChangedInLastUpdate()) {
} else if (materialsChanged) {
meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray();
}
if (materialsChanged && (this.maskMaterials.AnyMaterialCreated)) {
this.maskMaterials = new SpriteMaskInteractionMaterials();
}
meshGenerator.FillLateVertexData(currentMesh);
@ -512,6 +524,11 @@ namespace Spine.Unity {
}
#endif
if (Application.isPlaying) {
if (maskInteraction != SpriteMaskInteraction.None && maskMaterials.materialsMaskDisabled.Length == 0)
maskMaterials.materialsMaskDisabled = meshRenderer.sharedMaterials;
}
if (maskMaterials.materialsMaskDisabled.Length > 0 && maskMaterials.materialsMaskDisabled[0] != null &&
maskInteraction == SpriteMaskInteraction.None) {
this.meshRenderer.materials = maskMaterials.materialsMaskDisabled;