本文整理汇总了C#中UnityEngine.GetStates方法的典型用法代码示例。如果您正苦于以下问题:C# UnityEngine.GetStates方法的具体用法?C# UnityEngine.GetStates怎么用?C# UnityEngine.GetStates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine
的用法示例。
在下文中一共展示了UnityEngine.GetStates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw_INTERNAL
private static int Draw_INTERNAL(int id, System.Action<int> onResult, ClipType clipType, UnityEngine.UI.Windows.Audio.Data data, GUIContent label, Rect rect, bool layout) {
if (data != null) {
var states = data.GetStates(clipType);
var keys = new int[states.Count + 1];
var options = new GUIContent[states.Count + 1];
var selected = string.Empty;
var k = 0;
for (int i = -1; i < states.Count; ++i) {
var category = string.Empty;
var name = string.Empty;
if (i == -1) {
name = "None";
} else {
category = states[i].category;
keys[k] = states[i].key;
var clip = states[i].clip;
name = clip == null ? "Null" : clip.ToString();
}
if (string.IsNullOrEmpty(category) == false) {
category = category.Trim('/').Trim() + "/";
}
options[k] = new GUIContent((i >= 0) ? string.Format(category + "[{0}] {1}", keys[k], name) : name);
if (id == keys[k]) {
selected = options[k].text;
}
++k;
}
if (layout == true) {
Popup.DrawInt(label, selected, onResult, options, keys);
} else {
Popup.DrawInt(rect, selected, label, onResult, options, keys);
}
}
return id;
}