本文整理汇总了C#中GenericMenu.DropDown方法的典型用法代码示例。如果您正苦于以下问题:C# GenericMenu.DropDown方法的具体用法?C# GenericMenu.DropDown怎么用?C# GenericMenu.DropDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericMenu
的用法示例。
在下文中一共展示了GenericMenu.DropDown方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnFlowWindowGUI
public override void OnFlowWindowGUI(FD.FlowWindow window) {
if (Social.settings == null) return;
var socialFlag = (window.flags & Social.settings.uniqueTag) == Social.settings.uniqueTag;
if (socialFlag == true) {
var settings = Social.settings;
if (settings == null) return;
var data = settings.data.Get(window);
var isActiveSelected = settings.IsPlatformActive(data.settings);
var oldColor = GUI.color;
GUI.color = isActiveSelected ? Color.white : Color.grey;
var result = GUILayoutExt.LargeButton(data.settings ? data.settings.GetPlatformName() : "None", 60f, 150f);
GUI.color = oldColor;
var rect = GUILayoutUtility.GetLastRect();
rect.y += rect.height;
if (result == true) {
var menu = new GenericMenu();
menu.AddItem(new GUIContent("None"), data.settings == null, () => {
data.settings = null;
});
foreach (var platform in settings.activePlatforms) {
if (platform.active == true) {
var item = platform.settings;
menu.AddItem(new GUIContent(platform.GetPlatformName()), data.settings == platform.settings, () => {
data.settings = item;
});
} else {
menu.AddDisabledItem(new GUIContent(platform.GetPlatformName()));
}
}
menu.DropDown(rect);
}
}
}
示例2: Show
internal static void Show(string folder, string currentSubFolder, Rect activatorRect, ProjectBrowser caller)
{
m_Caller = caller;
string[] subFolders = AssetDatabase.GetSubFolders(folder);
GenericMenu menu = new GenericMenu();
if (subFolders.Length >= 0)
{
currentSubFolder = Path.GetFileName(currentSubFolder);
foreach (string str in subFolders)
{
string fileName = Path.GetFileName(str);
menu.AddItem(new GUIContent(fileName), fileName == currentSubFolder, new GenericMenu.MenuFunction(new ProjectBrowser.BreadCrumbListMenu(str).SelectSubFolder));
menu.ShowAsContext();
}
}
else
{
menu.AddDisabledItem(new GUIContent("No sub folders..."));
}
menu.DropDown(activatorRect);
}
示例3: OnFlowWindowGUI
//.........这里部分代码省略.........
if (attachWindow.IsFunction() == true) {
alreadyConnectedFunctionIds.Add(attachWindow.GetFunctionId());
}
}
}
foreach (var win in data.windows) {
if (win.IsFunction() == true &&
win.IsContainer() == true) {
var count = alreadyConnectedFunctionIds.Count((e) => e == win.id);
if ((window.GetFunctionId() == win.id && count == 1) || count == 0) {
} else {
if (win.id == window.functionId) window.functionId = 0;
alreadyConnectedFunctionIds.Remove(win.id);
}
}
}
var functionId = window.GetFunctionId();
var functionContainer = functionId == 0 ? null : data.GetWindow(functionId);
var isActiveSelected = true;
var oldColor = GUI.color;
GUI.color = isActiveSelected ? Color.white : Color.grey;
var result = GUILayoutExt.LargeButton(functionContainer != null ? functionContainer.title : "None", GUILayout.MaxHeight(60f), GUILayout.MaxWidth(150f));
GUI.color = oldColor;
var rect = GUILayoutUtility.GetLastRect();
rect.y += rect.height;
if (result == true) {
var menu = new GenericMenu();
menu.AddItem(new GUIContent("None"), window.functionId == 0, () => {
window.functionId = 0;
});
if (windowFrom != null) {
alreadyConnectedFunctionIds.Clear();
var attaches = windowFrom.GetAttachedWindows();
foreach (var attachWindow in attaches) {
if (attachWindow.IsFunction() == true) {
alreadyConnectedFunctionIds.Add(attachWindow.GetFunctionId());
}
}
}
foreach (var win in data.windows) {
if (win.IsFunction() == true &&
win.IsContainer() == true) {
var count = alreadyConnectedFunctionIds.Count((e) => e == win.id);
if ((window.GetFunctionId() == win.id && count == 1) || count == 0) {
var id = win.id;
menu.AddItem(new GUIContent(win.title), win.id == window.functionId, () => {
window.functionId = id;
});
} else {
if (win.id == window.functionId) window.functionId = 0;
alreadyConnectedFunctionIds.Remove(win.id);
menu.AddDisabledItem(new GUIContent(win.title));
}
}
}
menu.DropDown(rect);
}
}
}
示例4: OnFlowWindowGUI
public override void OnFlowWindowGUI(FlowWindow window) {
var data = FlowSystem.GetData();
if (data == null) return;
var flag = window.IsFunction() == true &&
window.IsSmall() == true &&
window.IsContainer() == false;
if (flag == true) {
var functionId = window.GetFunctionId();
var functionContainer = data.GetWindow(functionId);
var isActiveSelected = true;
var oldColor = GUI.color;
GUI.color = isActiveSelected ? Color.white : Color.grey;
var result = GUILayoutExt.LargeButton(functionContainer != null ? functionContainer.title : "None", 60f, 150f);
GUI.color = oldColor;
var rect = GUILayoutUtility.GetLastRect();
rect.y += rect.height;
if (result == true) {
var menu = new GenericMenu();
menu.AddItem(new GUIContent("None"), window.functionId == 0, () => {
window.functionId = 0;
});
foreach (var win in data.windows) {
if (win.IsFunction() == true &&
win.IsContainer() == true) {
var id = win.id;
menu.AddItem(new GUIContent(win.title), win.id == window.functionId, () => {
window.functionId = id;
});
}
}
menu.DropDown(rect);
}
}
}
示例5: OnCompilerTransitionAttachedGeneration
//.........这里部分代码省略.........
var rect = GUILayoutUtility.GetLastRect();
rect.y += rect.height;
if (result == true) {
System.Action<int> onApply = (int id) => {
var linkerSources = new List<FD.FlowWindow>();
foreach (var w in data.windowAssets) {
if (w.AlreadyAttached(window.id) == true) {
linkerSources.Add(w);
}
}
if (window.linkerId != 0) {
foreach (var w in linkerSources) {
data.Detach(w.id, window.linkerId, oneWay: true);
}
}
window.linkerId = id;
if (window.linkerId != 0) {
foreach (var w in linkerSources) {
data.Attach(w.id, window.linkerId, oneWay: true);
}
}
};
var menu = new GenericMenu();
menu.AddItem(new GUIContent("None"), window.linkerId == 0, () => {
onApply(0);
});
if (windowFrom != null) {
alreadyConnectedFunctionIds.Clear();
var attaches = windowFrom.GetAttachedWindows();
foreach (var attachWindow in attaches) {
if (attachWindow.IsLinker() == true) {
alreadyConnectedFunctionIds.Add(attachWindow.GetLinkerId());
}
}
}
foreach (var win in data.windowAssets) {
if (win.CanDirectCall() == true) {
var caption = new GUIContent(string.Format("{0} ({1})", win.title, win.directory));
var count = alreadyConnectedFunctionIds.Count((e) => e == win.id);
if ((window.GetLinkerId() == win.id && count == 1) || count == 0) {
var id = win.id;
menu.AddItem(caption, win.id == window.GetLinkerId(), () => {
onApply(id);
});
} else {
if (win.id == window.GetLinkerId()) window.linkerId = 0;
alreadyConnectedFunctionIds.Remove(win.id);
menu.AddDisabledItem(caption);
}
}
}
menu.DropDown(rect);
}
}
}
示例6: Show
public static void Show(Rect buttonRect, int viewIndex, AudioMixerGroupViewList list)
{
GenericMenu menu = new GenericMenu();
data userData = new data {
viewIndex = viewIndex,
list = list
};
menu.AddItem(new GUIContent("Rename"), false, new GenericMenu.MenuFunction2(AudioMixerGroupViewList.ViewsContexttMenu.Rename), userData);
menu.AddItem(new GUIContent("Duplicate"), false, new GenericMenu.MenuFunction2(AudioMixerGroupViewList.ViewsContexttMenu.Duplicate), userData);
menu.AddItem(new GUIContent("Delete"), false, new GenericMenu.MenuFunction2(AudioMixerGroupViewList.ViewsContexttMenu.Delete), userData);
menu.DropDown(buttonRect);
}