mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[Unity] SpineAttributeBase & EventDataAttribute
This commit is contained in:
parent
da10b70b84
commit
7d002f99e5
@ -7,9 +7,12 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
public class SpineSlot : PropertyAttribute {
|
public abstract class SpineAttributeBase : PropertyAttribute {
|
||||||
public string startsWith = "";
|
|
||||||
public string dataField = "";
|
public string dataField = "";
|
||||||
|
public string startsWith = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SpineSlot : SpineAttributeBase {
|
||||||
public bool containsBoundingBoxes = false;
|
public bool containsBoundingBoxes = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -28,10 +31,22 @@ public class SpineSlot : PropertyAttribute {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpineSkin : PropertyAttribute {
|
public class SpineEventData : SpineAttributeBase {
|
||||||
public string startsWith = "";
|
/// <summary>
|
||||||
public string dataField = "";
|
/// Smart popup menu for Spine Events (Spine.EventData)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="startsWith">Filters popup results to elements that begin with supplied string.</param>
|
||||||
|
/// <param name="dataField">If specified, a locally scoped field with the name supplied by in dataField will be used to fill the popup results.
|
||||||
|
/// Valid types are SkeletonDataAsset and SkeletonRenderer (and derivatives).
|
||||||
|
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent<SkeletonRenderer>() will be called as a fallback.
|
||||||
|
/// </param>
|
||||||
|
public SpineEventData(string startsWith = "", string dataField = "") {
|
||||||
|
this.startsWith = startsWith;
|
||||||
|
this.dataField = dataField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SpineSkin : SpineAttributeBase {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Smart popup menu for Spine Skins
|
/// Smart popup menu for Spine Skins
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -45,10 +60,7 @@ public class SpineSkin : PropertyAttribute {
|
|||||||
this.dataField = dataField;
|
this.dataField = dataField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class SpineAnimation : PropertyAttribute {
|
public class SpineAnimation : SpineAttributeBase {
|
||||||
public string startsWith = "";
|
|
||||||
public string dataField = "";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Smart popup menu for Spine Animations
|
/// Smart popup menu for Spine Animations
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -63,18 +75,12 @@ public class SpineAnimation : PropertyAttribute {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpineAttachment : PropertyAttribute {
|
public class SpineAttachment : SpineAttributeBase {
|
||||||
public bool returnAttachmentPath = false;
|
public bool returnAttachmentPath = false;
|
||||||
public bool currentSkinOnly = false;
|
public bool currentSkinOnly = false;
|
||||||
public bool placeholdersOnly = false;
|
public bool placeholdersOnly = false;
|
||||||
public string dataField = "";
|
|
||||||
public string slotField = "";
|
public string slotField = "";
|
||||||
|
|
||||||
|
|
||||||
public SpineAttachment () {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Smart popup menu for Spine Attachments
|
/// Smart popup menu for Spine Attachments
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -122,7 +128,8 @@ public class SpineAttachment : PropertyAttribute {
|
|||||||
slot = "";
|
slot = "";
|
||||||
name = "";
|
name = "";
|
||||||
return;
|
return;
|
||||||
} else if (chunks.Length < 2) {
|
}
|
||||||
|
else if (chunks.Length < 2) {
|
||||||
throw new System.Exception("Cannot generate Attachment Hierarchy from string! Not enough components! [" + fullPath + "]");
|
throw new System.Exception("Cannot generate Attachment Hierarchy from string! Not enough components! [" + fullPath + "]");
|
||||||
}
|
}
|
||||||
skin = chunks[0];
|
skin = chunks[0];
|
||||||
@ -135,10 +142,7 @@ public class SpineAttachment : PropertyAttribute {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpineBone : PropertyAttribute {
|
public class SpineBone : SpineAttributeBase {
|
||||||
public string startsWith = "";
|
|
||||||
public string dataField = "";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Smart popup menu for Spine Bones
|
/// Smart popup menu for Spine Bones
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user