本文整理匯總了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);
}