mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-15 03:21:35 +08:00
[unity] SpineEvent attribute audioOnly flag.
This commit is contained in:
parent
12e7ebf78f
commit
533a25286a
@ -158,7 +158,7 @@ namespace Spine.Unity.Editor {
|
||||
protected virtual void HandleSelect (object menuItemObject) {
|
||||
var clickedItem = (SpineDrawerValuePair)menuItemObject;
|
||||
var serializedProperty = clickedItem.property;
|
||||
if (serializedProperty.serializedObject.isEditingMultipleObjects) serializedProperty.stringValue = "oaifnoiasf°ñ123526"; // HACK: to trigger change on multi-editing.
|
||||
if (serializedProperty.serializedObject.isEditingMultipleObjects) serializedProperty.stringValue = "oaifnoiasf°ñ123526"; // HACK: to trigger change on multi-editing.
|
||||
serializedProperty.stringValue = clickedItem.stringValue;
|
||||
serializedProperty.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
@ -336,9 +336,14 @@ namespace Spine.Unity.Editor {
|
||||
menu.AddItem(new GUIContent(NoneString), !property.hasMultipleDifferentValues && string.IsNullOrEmpty(property.stringValue), HandleSelect, new SpineDrawerValuePair(string.Empty, property));
|
||||
|
||||
for (int i = 0; i < events.Count; i++) {
|
||||
string name = events.Items[i].Name;
|
||||
if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal))
|
||||
menu.AddItem(new GUIContent(name), !property.hasMultipleDifferentValues && name == property.stringValue, HandleSelect, new SpineDrawerValuePair(name, property));
|
||||
var eventObject = events.Items[i];
|
||||
string name = eventObject.Name;
|
||||
if (name.StartsWith(targetAttribute.startsWith, StringComparison.Ordinal)) {
|
||||
if (!TargetAttribute.audioOnly || !string.IsNullOrEmpty(eventObject.AudioPath)) {
|
||||
menu.AddItem(new GUIContent(name), !property.hasMultipleDifferentValues && name == property.stringValue, HandleSelect, new SpineDrawerValuePair(name, property));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -123,11 +123,15 @@ namespace Spine.Unity {
|
||||
/// If left empty and the script the attribute is applied to is derived from Component, GetComponent(SkeletonRenderer)() will be called as a fallback.
|
||||
/// </param>
|
||||
/// <param name="fallbackToTextField">If true, and an animation list source can't be found, the field will fall back to a normal text field. If false, it will show an error.</param>
|
||||
public SpineEvent (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false) {
|
||||
|
||||
public bool audioOnly = false;
|
||||
|
||||
public SpineEvent (string startsWith = "", string dataField = "", bool includeNone = true, bool fallbackToTextField = false, bool audioOnly = false) {
|
||||
this.startsWith = startsWith;
|
||||
this.dataField = dataField;
|
||||
this.includeNone = includeNone;
|
||||
this.fallbackToTextField = fallbackToTextField;
|
||||
this.audioOnly = audioOnly;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user