mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
Merge branch '3.8' of https://github.com/esotericsoftware/spine-runtimes into 3.8
This commit is contained in:
commit
209425c05a
@ -115,8 +115,10 @@ public class JsonRollback {
|
|||||||
JsonValue skins = root.get("skins");
|
JsonValue skins = root.get("skins");
|
||||||
if (skins != null && skins.isArray()) {
|
if (skins != null && skins.isArray()) {
|
||||||
JsonValue newSkins = new JsonValue(ValueType.object);
|
JsonValue newSkins = new JsonValue(ValueType.object);
|
||||||
for (JsonValue skinMap = skins.child; skinMap != null; skinMap = skinMap.next)
|
for (JsonValue skinMap = skins.child; skinMap != null; skinMap = skinMap.next) {
|
||||||
newSkins.addChild(skinMap.getString("name"), skinMap.get("attachments"));
|
JsonValue attachments = skinMap.get("attachments");
|
||||||
|
if (attachments != null) newSkins.addChild(skinMap.getString("name"), skinMap.get("attachments"));
|
||||||
|
}
|
||||||
root.remove("skins");
|
root.remove("skins");
|
||||||
root.addChild("skins", newSkins);
|
root.addChild("skins", newSkins);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -297,12 +297,8 @@ namespace Spine.Unity {
|
|||||||
|
|
||||||
// Clear
|
// Clear
|
||||||
{
|
{
|
||||||
if (meshFilter != null)
|
// Note: do not reset meshFilter.sharedMesh or meshRenderer.sharedMaterial to null,
|
||||||
meshFilter.sharedMesh = null;
|
// otherwise constant reloading will be triggered at prefabs.
|
||||||
|
|
||||||
meshRenderer = GetComponent<MeshRenderer>();
|
|
||||||
if (meshRenderer != null && meshRenderer.enabled) meshRenderer.sharedMaterial = null;
|
|
||||||
|
|
||||||
currentInstructions.Clear();
|
currentInstructions.Clear();
|
||||||
rendererBuffers.Clear();
|
rendererBuffers.Clear();
|
||||||
meshGenerator.Begin();
|
meshGenerator.Begin();
|
||||||
@ -352,6 +348,15 @@ namespace Spine.Unity {
|
|||||||
public virtual void LateUpdate () {
|
public virtual void LateUpdate () {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR && NEW_PREFAB_SYSTEM
|
||||||
|
// Don't store mesh or material at the prefab, otherwise it will permanently reload
|
||||||
|
var prefabType = UnityEditor.PrefabUtility.GetPrefabAssetType(this);
|
||||||
|
if (!UnityEditor.PrefabUtility.IsPartOfPrefabInstance(this) &&
|
||||||
|
(prefabType == UnityEditor.PrefabAssetType.Regular || prefabType == UnityEditor.PrefabAssetType.Variant)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SPINE_OPTIONAL_RENDEROVERRIDE
|
#if SPINE_OPTIONAL_RENDEROVERRIDE
|
||||||
bool doMeshOverride = generateMeshOverride != null;
|
bool doMeshOverride = generateMeshOverride != null;
|
||||||
if ((!meshRenderer.enabled) && !doMeshOverride) return;
|
if ((!meshRenderer.enabled) && !doMeshOverride) return;
|
||||||
@ -397,17 +402,17 @@ namespace Spine.Unity {
|
|||||||
MeshGenerator.GenerateSkeletonRendererInstruction(currentInstructions, skeleton, customSlotMaterials, separatorSlots, doMeshOverride, this.immutableTriangles);
|
MeshGenerator.GenerateSkeletonRendererInstruction(currentInstructions, skeleton, customSlotMaterials, separatorSlots, doMeshOverride, this.immutableTriangles);
|
||||||
|
|
||||||
// STEP 1.9. Post-process workingInstructions. ==================================================================================
|
// STEP 1.9. Post-process workingInstructions. ==================================================================================
|
||||||
#if SPINE_OPTIONAL_MATERIALOVERRIDE
|
#if SPINE_OPTIONAL_MATERIALOVERRIDE
|
||||||
if (customMaterialOverride.Count > 0) // isCustomMaterialOverridePopulated
|
if (customMaterialOverride.Count > 0) // isCustomMaterialOverridePopulated
|
||||||
MeshGenerator.TryReplaceMaterials(workingSubmeshInstructions, customMaterialOverride);
|
MeshGenerator.TryReplaceMaterials(workingSubmeshInstructions, customMaterialOverride);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SPINE_OPTIONAL_RENDEROVERRIDE
|
#if SPINE_OPTIONAL_RENDEROVERRIDE
|
||||||
if (doMeshOverride) {
|
if (doMeshOverride) {
|
||||||
this.generateMeshOverride(currentInstructions);
|
this.generateMeshOverride(currentInstructions);
|
||||||
if (disableRenderingOnOverride) return;
|
if (disableRenderingOnOverride) return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
updateTriangles = SkeletonRendererInstruction.GeometryNotEqual(currentInstructions, currentSmartMesh.instructionUsed);
|
updateTriangles = SkeletonRendererInstruction.GeometryNotEqual(currentInstructions, currentSmartMesh.instructionUsed);
|
||||||
|
|
||||||
@ -444,7 +449,7 @@ namespace Spine.Unity {
|
|||||||
}
|
}
|
||||||
if (materialsChanged && (this.maskMaterials.AnyMaterialCreated)) {
|
if (materialsChanged && (this.maskMaterials.AnyMaterialCreated)) {
|
||||||
this.maskMaterials = new SpriteMaskInteractionMaterials();
|
this.maskMaterials = new SpriteMaskInteractionMaterials();
|
||||||
}
|
}
|
||||||
|
|
||||||
meshGenerator.FillLateVertexData(currentMesh);
|
meshGenerator.FillLateVertexData(currentMesh);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user