mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-02 21:59:09 +08:00
Merge branch '3.8' into 3.9-beta
This commit is contained in:
commit
f956dc4bfc
@ -6147,7 +6147,7 @@ var spine;
|
|||||||
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
||||||
};
|
};
|
||||||
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
||||||
if (!map.curve)
|
if (!map.hasOwnProperty("curve"))
|
||||||
return;
|
return;
|
||||||
if (map.curve == "stepped")
|
if (map.curve == "stepped")
|
||||||
timeline.setStepped(frameIndex);
|
timeline.setStepped(frameIndex);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6147,7 +6147,7 @@ var spine;
|
|||||||
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
||||||
};
|
};
|
||||||
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
||||||
if (!map.curve)
|
if (!map.hasOwnProperty("curve"))
|
||||||
return;
|
return;
|
||||||
if (map.curve == "stepped")
|
if (map.curve == "stepped")
|
||||||
timeline.setStepped(frameIndex);
|
timeline.setStepped(frameIndex);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6147,7 +6147,7 @@ var spine;
|
|||||||
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
||||||
};
|
};
|
||||||
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
||||||
if (!map.curve)
|
if (!map.hasOwnProperty("curve"))
|
||||||
return;
|
return;
|
||||||
if (map.curve == "stepped")
|
if (map.curve == "stepped")
|
||||||
timeline.setStepped(frameIndex);
|
timeline.setStepped(frameIndex);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6147,7 +6147,7 @@ var spine;
|
|||||||
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
||||||
};
|
};
|
||||||
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
||||||
if (!map.curve)
|
if (!map.hasOwnProperty("curve"))
|
||||||
return;
|
return;
|
||||||
if (map.curve == "stepped")
|
if (map.curve == "stepped")
|
||||||
timeline.setStepped(frameIndex);
|
timeline.setStepped(frameIndex);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6147,7 +6147,7 @@ var spine;
|
|||||||
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
||||||
};
|
};
|
||||||
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
||||||
if (!map.curve)
|
if (!map.hasOwnProperty("curve"))
|
||||||
return;
|
return;
|
||||||
if (map.curve == "stepped")
|
if (map.curve == "stepped")
|
||||||
timeline.setStepped(frameIndex);
|
timeline.setStepped(frameIndex);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -6147,7 +6147,7 @@ var spine;
|
|||||||
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
skeletonData.animations.push(new spine.Animation(name, timelines, duration));
|
||||||
};
|
};
|
||||||
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {
|
||||||
if (!map.curve)
|
if (!map.hasOwnProperty("curve"))
|
||||||
return;
|
return;
|
||||||
if (map.curve == "stepped")
|
if (map.curve == "stepped")
|
||||||
timeline.setStepped(frameIndex);
|
timeline.setStepped(frameIndex);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -784,7 +784,7 @@ module spine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readCurve (map: any, timeline: CurveTimeline, frameIndex: number) {
|
readCurve (map: any, timeline: CurveTimeline, frameIndex: number) {
|
||||||
if (!map.curve) return;
|
if (!map.hasOwnProperty("curve")) return;
|
||||||
if (map.curve == "stepped")
|
if (map.curve == "stepped")
|
||||||
timeline.setStepped(frameIndex);
|
timeline.setStepped(frameIndex);
|
||||||
else {
|
else {
|
||||||
|
|||||||
24
spine-ts/player/example/embedding-binary-example.html
Normal file
24
spine-ts/player/example/embedding-binary-example.html
Normal file
File diff suppressed because one or more lines are too long
24
spine-ts/player/example/embedding-json-example.html
Normal file
24
spine-ts/player/example/embedding-json-example.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -117,6 +117,14 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class SpriteMaskInteractionMaterials {
|
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>
|
/// <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];
|
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>
|
/// <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);
|
rendererBuffers.UpdateSharedMaterials(workingSubmeshInstructions);
|
||||||
|
|
||||||
|
bool materialsChanged = rendererBuffers.MaterialsChangedInLastUpdate();
|
||||||
if (updateTriangles) { // Check if the triangles should also be updated.
|
if (updateTriangles) { // Check if the triangles should also be updated.
|
||||||
meshGenerator.FillTriangles(currentMesh);
|
meshGenerator.FillTriangles(currentMesh);
|
||||||
meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray();
|
meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray();
|
||||||
} else if (rendererBuffers.MaterialsChangedInLastUpdate()) {
|
} else if (materialsChanged) {
|
||||||
meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray();
|
meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray();
|
||||||
}
|
}
|
||||||
|
if (materialsChanged && (this.maskMaterials.AnyMaterialCreated)) {
|
||||||
|
this.maskMaterials = new SpriteMaskInteractionMaterials();
|
||||||
|
}
|
||||||
|
|
||||||
meshGenerator.FillLateVertexData(currentMesh);
|
meshGenerator.FillLateVertexData(currentMesh);
|
||||||
|
|
||||||
@ -512,6 +524,11 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
#endif
|
#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 &&
|
if (maskMaterials.materialsMaskDisabled.Length > 0 && maskMaterials.materialsMaskDisabled[0] != null &&
|
||||||
maskInteraction == SpriteMaskInteraction.None) {
|
maskInteraction == SpriteMaskInteraction.None) {
|
||||||
this.meshRenderer.materials = maskMaterials.materialsMaskDisabled;
|
this.meshRenderer.materials = maskMaterials.materialsMaskDisabled;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user