[unity] Fix <none> item for [SpineSlot] attribute.

This commit is contained in:
John 2018-02-08 21:32:09 +08:00 committed by GitHub
parent d27a9a3d87
commit f5d62bf88a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,6 +159,10 @@ namespace Spine.Unity.Editor {
protected override Texture2D Icon { get { return SpineEditorUtilities.Icons.slot; } }
protected override void PopulateMenu (GenericMenu menu, SerializedProperty property, SpineSlot targetAttribute, SkeletonData data) {
if (TargetAttribute.includeNone)
menu.AddItem(new GUIContent(NoneString), string.IsNullOrEmpty(property.stringValue), HandleSelect, new SpineDrawerValuePair(string.Empty, property));
for (int i = 0; i < data.Slots.Count; i++) {
string name = data.Slots.Items[i].Name;
if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal)) {