[unity] SkeletonGraphic: avoid unnecessary redundant mesh update at color change (necessary after commit c36f847). See #2049.

This commit is contained in:
Harald Csaszar 2024-03-19 17:46:28 +01:00
parent 94eb64ae94
commit 94d8a3a387
2 changed files with 8 additions and 1 deletions

View File

@ -155,7 +155,7 @@ namespace Spine.Unity.Editor {
// MaskableGraphic
material = so.FindProperty("m_Material");
color = so.FindProperty("m_Color");
color = so.FindProperty("m_SkeletonColor");
raycastTarget = so.FindProperty("m_RaycastTarget");
maskable = so.FindProperty("m_Maskable");

View File

@ -60,6 +60,13 @@ namespace Spine.Unity {
public Material multiplyMaterial;
public Material screenMaterial;
/// <summary>Own color to replace <c>Graphic.m_Color</c>.</summary>
[UnityEngine.Serialization.FormerlySerializedAs("m_Color")]
[SerializeField] protected Color m_SkeletonColor = Color.white;
/// <summary>Sets the color of the skeleton. Does not call <see cref="Rebuild"/> and <see cref="UpdateMesh"/>
/// unnecessarily as <c>Graphic.color</c> would otherwise do.</summary>
override public Color color { get { return m_SkeletonColor; } set { m_SkeletonColor = value; } }
[SpineSkin(dataField: "skeletonDataAsset", defaultAsEmptyString: true)]
public string initialSkinName;
public bool initialFlipX, initialFlipY;