From 4d89539b1b25255a0ac8ef9aa8ebe099248389f6 Mon Sep 17 00:00:00 2001 From: pharan Date: Wed, 23 Aug 2017 18:36:05 +0800 Subject: [PATCH] [unity] SkeletonRenderer.SetMeshSettings --- .../Assets/spine-unity/SkeletonRenderer.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs index ab6e71b56..1d2f004aa 100644 --- a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs +++ b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs @@ -61,13 +61,14 @@ namespace Spine.Unity { public bool useClipping = true; public bool immutableTriangles = false; public bool pmaVertexColors = true; + /// Clears the state when this component or its GameObject is disabled. This prevents previous state from being retained when it is enabled again. When pooling your skeleton, setting this to true can be helpful. public bool clearStateOnDisable = false; public bool tintBlack = false; public bool singleSubmesh = false; [UnityEngine.Serialization.FormerlySerializedAs("calculateNormals")] - public bool addNormals; - public bool calculateTangents; + public bool addNormals = false; + public bool calculateTangents = false; public bool logErrors = false; @@ -134,6 +135,18 @@ namespace Spine.Unity { } return c; } + + /// Applies MeshGenerator settings to the SkeletonRenderer and its internal MeshGenerator. + public void SetMeshSettings (MeshGenerator.Settings settings) { + this.calculateTangents = settings.calculateTangents; + this.immutableTriangles = settings.immutableTriangles; + this.pmaVertexColors = settings.pmaVertexColors; + this.tintBlack = settings.tintBlack; + this.useClipping = settings.useClipping; + this.zSpacing = settings.zSpacing; + + this.meshGenerator.settings = settings; + } #endregion public virtual void Awake () {