mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[unity] Fixed SkeletonRenderSeparator mesh being broken with slot alpha 0. Closes #2532.
This commit is contained in:
parent
aaa9b81628
commit
330e646c08
@ -39,6 +39,8 @@
|
||||
// Comment out this line to revert to previous behaviour.
|
||||
// You may only need this option disabled when utilizing a custom shader which
|
||||
// uses vertex color alpha for purposes other than transparency.
|
||||
//
|
||||
// Important Note: When disabling this define, also disable the one in SkeletonRenderInstruction.cs
|
||||
#define SLOT_ALPHA_DISABLES_ATTACHMENT
|
||||
|
||||
using System;
|
||||
|
||||
@ -31,6 +31,10 @@
|
||||
#define SPINE_TRIANGLECHECK // Avoid calling SetTriangles at the cost of checking for mesh differences (vertex counts, memberwise attachment list compare) every frame.
|
||||
//#define SPINE_DEBUG
|
||||
|
||||
// Important Note: When disabling this define, also disable the one in MeshGenerator.cs
|
||||
// For details, see MeshGenerator.cs.
|
||||
#define SLOT_ALPHA_DISABLES_ATTACHMENT
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -95,7 +99,14 @@ namespace Spine.Unity {
|
||||
Slot[] drawOrderItems = instructionsItems[0].skeleton.DrawOrder.Items;
|
||||
for (int i = 0; i < attachmentCount; i++) {
|
||||
Slot slot = drawOrderItems[startSlot + i];
|
||||
if (!slot.Bone.Active) continue;
|
||||
if (!slot.Bone.Active
|
||||
#if SLOT_ALPHA_DISABLES_ATTACHMENT
|
||||
|| slot.A == 0f
|
||||
#endif
|
||||
) {
|
||||
attachmentsItems[i] = null;
|
||||
continue;
|
||||
}
|
||||
attachmentsItems[i] = slot.Attachment;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "com.esotericsoftware.spine.spine-unity",
|
||||
"displayName": "spine-unity Runtime",
|
||||
"description": "This plugin provides the spine-unity runtime core.",
|
||||
"version": "4.2.64",
|
||||
"version": "4.2.65",
|
||||
"unity": "2018.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user