예제 #1
0
        private void DoMouseEvent(Rect rect, int deviceIndex)
        {
            var currentEvent = Event.current;

            switch (currentEvent.type)
            {
            case EventType.MouseDown:
                if (currentEvent.button == 0 && rect.Contains(currentEvent.mousePosition))
                {
                    m_SelectedDeviceIndex = deviceIndex;
                    currentEvent.Use();

                    editorWindow.Close();
                    OnDeviceSelected?.Invoke(m_SelectedDeviceIndex);
                }
                break;

            case EventType.MouseMove:
                if (rect.Contains(currentEvent.mousePosition))
                {
                    if (m_HoverDeviceIndex != deviceIndex)
                    {
                        m_HoverDeviceIndex = deviceIndex;
                        editorWindow.Repaint();
                    }
                    currentEvent.Use();
                }
                else if (m_HoverDeviceIndex == deviceIndex)
                {
                    m_HoverDeviceIndex = -1;
                    editorWindow.Repaint();
                }
                break;
            }
        }
예제 #2
0
        public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
        {
            var deviceModel = ViewModel.NearDevices[indexPath.Row];

            ViewModel.CurrentDeviceModel.DeviceId = deviceModel.DeviceId;

            OnDeviceSelected?.Invoke(this, deviceModel);
        }