本文整理汇总了C#中UnityEditor.GenericMenu.Popup方法的典型用法代码示例。如果您正苦于以下问题:C# GenericMenu.Popup方法的具体用法?C# GenericMenu.Popup怎么用?C# GenericMenu.Popup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEditor.GenericMenu
的用法示例。
在下文中一共展示了GenericMenu.Popup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowModePopup
private bool ShowModePopup(Rect popupRect)
{
int umbraDataSize = StaticOcclusionCulling.umbraDataSize;
if (this.m_PreVis != StaticOcclusionCullingVisualization.showPreVisualization)
SceneView.RepaintAll();
if (Event.current.type == EventType.Layout)
this.m_PreVis = StaticOcclusionCullingVisualization.showPreVisualization;
string[] strArray = new string[2]{ "Edit", "Visualize" };
int selectedIndex = !this.m_PreVis ? 1 : 0;
if (EditorGUI.ButtonMouseDown(popupRect, new GUIContent(strArray[selectedIndex]), FocusType.Passive, EditorStyles.popup))
{
GenericMenu genericMenu = new GenericMenu();
genericMenu.AddItem(new GUIContent(strArray[0]), selectedIndex == 0, new GenericMenu.MenuFunction(this.SetShowVolumePreVis));
if (umbraDataSize > 0)
genericMenu.AddItem(new GUIContent(strArray[1]), selectedIndex == 1, new GenericMenu.MenuFunction(this.SetShowVolumeCulling));
else
genericMenu.AddDisabledItem(new GUIContent(strArray[1]));
genericMenu.Popup(popupRect, selectedIndex);
}
return this.m_PreVis;
}
示例2: AddButton
public void AddButton(Rect rect, ReorderableList list)
{
GenericMenu genericMenu = new GenericMenu();
genericMenu.AddItem(new GUIContent("Add Motion Field"), false, new GenericMenu.MenuFunction(this.AddChildAnimation));
genericMenu.AddItem(EditorGUIUtility.TempContent("New Blend Tree"), false, new GenericMenu.MenuFunction(this.AddBlendTreeCallback));
genericMenu.Popup(rect, 0);
}