示例#1
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Right)
     {
         Debug.Log("Open Menu");
         UIContextMenuManager.OpenContextMenu("beatMenu", eventData.position, this);
     }
 }
示例#2
0
 public UIContextMenu Open(UIContextMenuManager manager)
 {
     foreach (UIContextMenuItem menuItem in menuItems)
     {
         manager.RenderMenuItem(menuItem);
     }
     return(this);
 }
示例#3
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Left)
     {
         action.Invoke(target);
         UIContextMenuManager.CloseContextMenu();
     }
 }
示例#4
0
 void CreateCOntextMenus()
 {
     //Beat control
     UIContextMenuManager.AddContextMenu("beatMenu").AddMenuItem(new UIContextMenuItem("Remove", RemoveBeat)).AddMenuItem(new UIContextMenuItem("Edit Beat", ConfigureBeat));
     //Track Control
     UIContextMenuManager.AddContextMenu("trackMenu").AddMenuItem(new UIContextMenuItem("Remove", RemoveTrack)).AddMenuItem(new UIContextMenuItem("Edit Track", ConfigureTrack));
     //File Menu
     UIContextMenuManager.AddContextMenu("fileMenu").AddMenuItem(new UIContextMenuItem("Save", SaveSong)).AddMenuItem(new UIContextMenuItem("Save As", SaveSongAs)).AddMenuItem(new UIContextMenuItem("Play", PlaySong)).AddMenuItem(new UIContextMenuItem("Exit", ExitEditor)).SetMargins(20, 0, 0, 0).AddMenuItem(new UIContextMenuItem("Exit", ExitEditor));
 }
示例#5
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (UIContextMenuManager.instance.openMenu == "fileMenu")
     {
         UIContextMenuManager.CloseContextMenu();
     }
     else
     {
         UIContextMenuManager.OpenContextMenu("fileMenu", _pos, null);
     }
 }
示例#6
0
 //On Click event handler
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Left)
     {
         if (!eventData.dragging)
         {
             AddBeat(Utils.TransformToTime(eventData.position.x, _left));
         }
     }
     else if (eventData.button == PointerEventData.InputButton.Right)
     {
         UIContextMenuManager.OpenContextMenu("trackMenu", eventData.position, this);
     }
 }