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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user