public void OnPointerExit(PointerEventData eventData)
 {
     if (InputManager.Instance.CurrentInputDevice != InputManager.GameInputDevice.KeyboardAndMouse)
     {
         OnDeselected?.Invoke(this);
     }
 }
 private void SelectChange(UIElement source, EventArgs <bool> e)
 {
     if (e.Value)
     {
         UIRadioButton radio = (UIRadioButton)source;
         selected.Add(radio);
         OnSelected?.Invoke(this, new UIRadioButtonEventArgs(radio));
         if (!Multiselect)
         {
             for (int i = 0; i < selected.Count; i++)
             {
                 if (selected[i] != radio)
                 {
                     selected[i].Selected = false;
                 }
             }
         }
     }
     else
     {
         UIRadioButton radio = (UIRadioButton)source;
         selected.Remove(radio);
         OnDeselected?.Invoke(this, new UIRadioButtonEventArgs(radio));
         if (AlwaysSelected && selected.Count < 1)
         {
             radio.Selected = true;
             e.Value        = true;
         }
     }
 }
Exemplo n.º 3
0
        public override void OnDeselect(BaseEventData eventData)
        {
            base.OnDeselect(eventData);

            _isSelectable = false;
            OnDeselected?.Invoke();
        }
Exemplo n.º 4
0
 public void Deselect()
 {
     Selected = false;
     if (GUI.KeyboardDispatcher.Subscriber == this)
     {
         GUI.KeyboardDispatcher.Subscriber = null;
     }
     OnDeselected?.Invoke(this, Keys.None);
 }
Exemplo n.º 5
0
 void SelectorSelectable.Deselect()
 {
     if (!Selected)
     {
         throw new InvalidOperationException();
     }
     Selected = false;
     OnDeselected?.Invoke();
 }
Exemplo n.º 6
0
        public override void OnDeselect(BaseEventData eventData)
        {
            base.OnDeselect(eventData);

            if (OnDeselected != null)
            {
                OnDeselected.Invoke();
            }
        }
Exemplo n.º 7
0
 public void HandleDeselection()
 {
     IsSelected = false;
     m_Fill.gameObject.SetActive(false);
     if (!isSilent)
     {
         OnDeselected?.Invoke();
         onDeselected?.Invoke();
     }
 }
Exemplo n.º 8
0
 public void DeleteSelected()
 {
     if (currentlySelected != null)
     {
         var selectedPrimitive = currentlySelected.GetComponent <EditablePrimitive>();
         OnDeselected.Invoke(selectedPrimitive);
         Destroy(currentlySelected);
         currentlySelected = null;
     }
 }
Exemplo n.º 9
0
        void Deselect()
        {
            Gizmo_OLD.Detach();
            Gizmo_OLD.Visible = false;

            if (currentlySelected != null)
            {
                OnDeselected.Invoke(currentlySelected.GetComponent <EditableVertex>());
            }
        }
Exemplo n.º 10
0
    bool ISelectable.Deselect()
    {
        if (Is_clicked)
        {
            return(false);
        }

        OnDeselected?.Invoke(this, EventArgs.Empty);

        Is_selected = false;
        txt.text    = "";
        return(true);
    }
Exemplo n.º 11
0
        private void ChangeSelection(T _itemInList)
        {
            // Deselect
            lastSelectedItem = currentItem;
            onDeselected?.Invoke(currentItem);

            // Swap
            currentItem  = _itemInList;
            currentIndex = items.IndexOf(_itemInList);

            // Select
            onSelected?.Invoke(currentItem);
        }
Exemplo n.º 12
0
        void RegisterTag(Tag tag)
        {
            Tags.Add(tag);
            tag.OnSelected += () => {
                if (Tags.Contains(tag))
                {
                    OnSelected?.Invoke(tag);
                }
            };

            tag.OnDeselected += () => {
                if (Tags.Contains(tag))
                {
                    OnDeselected?.Invoke(tag);
                }
            };
        }
Exemplo n.º 13
0
        public void Deselect()
        {
            Gizmo_OLD.Detach();
            Gizmo_OLD.Visible = false;

            //place currently selected back into mesh
            if (currentlySelected != null)
            {
                var selectedPrimitive = currentlySelected.GetComponent <EditablePrimitive>();
                var editableMesh      = LevelEditor.CurrentLevel.EditableLevelMesh.GetMaterialMesh(selectedPrimitive.Material);
                editableMesh.AddPrimitive(selectedPrimitive.info);
                editableMesh.UpdateMesh();
                OnDeselected.Invoke(selectedPrimitive);
                Destroy(currentlySelected);
                currentlySelected = null;
            }
        }
Exemplo n.º 14
0
    private void Deselect()
    {
        if (selection.Selected)
        {
            foreach (var selectable in selection.Selectables)
            {
                selectable.Deselect();
            }

            if (selection.SelectionType == SelectionType.Structure)
            {
                OnStructuresDeselected?.Invoke();
            }

            OnDeselected?.Invoke();
            selection.Clear();
        }
    }
 public void Deselect()
 {
     IsSelected = false;
     selectionCircle.gameObject.SetActive(false);
     OnDeselected?.Invoke(unit);
 }
Exemplo n.º 16
0
 public void Deselect()
 {
     IsSelected = false;
     OnDeselected?.Invoke(node);
 }
Exemplo n.º 17
0
 public void Deselect()
 {
     OnDeselected?.Invoke();
 }
Exemplo n.º 18
0
 /// <summary>
 /// 取消选中(焦点)
 /// </summary>
 /// <param name="eventData"></param>
 public void OnDeselect(BaseEventData eventData)
 {
     gameObject.GetComponent <Toggle>().isOn = false;
     OnDeselected?.Invoke(this);
 }