public void OnPointerClick(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Right) { Debug.Log("Open Menu"); UIContextMenuManager.OpenContextMenu("beatMenu", eventData.position, this); } }
public UIContextMenu Open(UIContextMenuManager manager) { foreach (UIContextMenuItem menuItem in menuItems) { manager.RenderMenuItem(menuItem); } return(this); }
public void OnPointerClick(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Left) { action.Invoke(target); UIContextMenuManager.CloseContextMenu(); } }
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)); }
public void OnPointerClick(PointerEventData eventData) { if (UIContextMenuManager.instance.openMenu == "fileMenu") { UIContextMenuManager.CloseContextMenu(); } else { UIContextMenuManager.OpenContextMenu("fileMenu", _pos, null); } }
//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); } }