diff --git a/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs b/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs index 6129050e3..814fe574f 100644 --- a/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs +++ b/Assets/VRM/Runtime/BlendShape/BlendShapeAvatar.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using UniGLTF; using System.IO; +using UnityEngine.Serialization; #if UNITY_EDITOR using UnityEditor; #endif @@ -13,23 +14,34 @@ namespace VRM [CreateAssetMenu(menuName = "VRM/BlendShapeAvatar")] public class BlendShapeAvatar : ScriptableObject { + [FormerlySerializedAs("Clips")] [SerializeField] - public List Clips = new List(); + private List clips = new List(); + + public List Clips + { + get + { + RemoveNullClip(); + return clips; + } + set => clips = value; + } /// /// NullのClipを削除して詰める /// public void RemoveNullClip() { - if (Clips == null) + if (clips == null) { return; } - for (int i = Clips.Count - 1; i >= 0; --i) + for (int i = clips.Count - 1; i >= 0; --i) { - if (Clips[i] == null) + if (clips[i] == null) { - Clips.RemoveAt(i); + clips.RemoveAt(i); } } }