Merge branch '3.8' into 4.0-beta

This commit is contained in:
badlogic 2020-10-29 15:43:48 +01:00
commit 81aee82c91
5 changed files with 10 additions and 9 deletions

View File

@ -163,11 +163,10 @@ cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer
CCASSERT(programState, "programState should not be null");
auto& pipelinePS = command->getPipelineDescriptor().programState;
if (pipelinePS != programState)
if (pipelinePS == nullptr || pipelinePS->getProgram() != programState->getProgram())
{
CC_SAFE_RELEASE(pipelinePS);
pipelinePS = programState;
CC_SAFE_RETAIN(pipelinePS);
pipelinePS = programState->clone();
updateProgramStateLayout(pipelinePS);
}

View File

@ -657,6 +657,9 @@ namespace Spine.Unity {
go.transform.localPosition = Vector3.zero;
var canvasRenderer = go.AddComponent<CanvasRenderer>();
canvasRenderers.Add(canvasRenderer);
var rawImage = go.AddComponent<RawImage>();
rawImage.maskable = this.maskable;
rawImage.raycastTarget = false;
}
}

View File

@ -47,7 +47,7 @@ namespace Spine.Unity.Playables {
public override double duration {
get {
if (template.animationReference == null)
if (template.animationReference == null || template.animationReference.Animation == null)
return 0;
return template.animationReference.Animation.Duration;
}

View File

@ -141,7 +141,7 @@ namespace Spine.Unity.Playables {
var skeleton = skeletonComponent.Skeleton;
bool skeletonDataMismatch = clipData.animationReference != null &&
bool skeletonDataMismatch = clipData.animationReference != null && clipData.animationReference.SkeletonDataAsset &&
skeletonComponent.SkeletonDataAsset.GetSkeletonData(true) != clipData.animationReference.SkeletonDataAsset.GetSkeletonData(true);
if (skeletonDataMismatch) {
Debug.LogWarningFormat("SpineAnimationStateMixerBehaviour tried to apply an animation for the wrong skeleton. Expected {0}. Was {1}",

View File

@ -119,13 +119,12 @@ namespace Spine {
if (count< 3) throw new ArgumentException("Polygon must contain at least 3 vertices");
offset <<= 1;
count <<= 1;
var firstX = polygonVertices[offset];
var firstY = polygonVertices[offset + 1];
var last = offset + count;
for (int i = offset, n = offset + count - 2; i<n; i += 2) {
for (int i = offset, n = offset + count; i < n; i += 2) {
var x1 = polygonVertices[i];
var y1 = polygonVertices[i + 1];