mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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.
|
// Comment out this line to revert to previous behaviour.
|
||||||
// You may only need this option disabled when utilizing a custom shader which
|
// You may only need this option disabled when utilizing a custom shader which
|
||||||
// uses vertex color alpha for purposes other than transparency.
|
// 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
|
#define SLOT_ALPHA_DISABLES_ATTACHMENT
|
||||||
|
|
||||||
using System;
|
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_TRIANGLECHECK // Avoid calling SetTriangles at the cost of checking for mesh differences (vertex counts, memberwise attachment list compare) every frame.
|
||||||
//#define SPINE_DEBUG
|
//#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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -95,7 +99,14 @@ namespace Spine.Unity {
|
|||||||
Slot[] drawOrderItems = instructionsItems[0].skeleton.DrawOrder.Items;
|
Slot[] drawOrderItems = instructionsItems[0].skeleton.DrawOrder.Items;
|
||||||
for (int i = 0; i < attachmentCount; i++) {
|
for (int i = 0; i < attachmentCount; i++) {
|
||||||
Slot slot = drawOrderItems[startSlot + 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;
|
attachmentsItems[i] = slot.Attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.2.64",
|
"version": "4.2.65",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user