Пример #1
0
 public virtual void FocusOn(UIActionEvent e)
 {
     IsFocused = true;
     OnFocused?.Invoke(e, this);
     if (PropagationRule.HasFlag(PropagationFlags.FocusOn))
     {
         Parent?.FocusOn(e);
     }
 }
Пример #2
0
 public void ShowOptions(object sender, EventArgs e)
 {
     if (OptionsMenu == null)
     {
         OptionsMenu = OptionsPrefab;
         TriggerAreas.Add(OptionsMenu.TriggerAreas[0]);
         OnFocused?.Invoke(this, new NodeEventArgs(OptionsMenu));
         FocusedNode?.OnUnfocused?.Invoke(this, new NodeEventArgs(FocusedNode));
         TriggerAreas.Add(OptionsMenu.TriggerAreas[0]);
     }
     else
     {
         OnOptionsHide?.Invoke(this, e);
     }
 }
Пример #3
0
        public void Focus()
        {
            if (IsFocused)
            {
                return;
            }

            IsFocused = true;

            _focusableObjects.ForEach(o => o.Focus());

            OnFocused?.Invoke(this, null);

            SetFocusStyle();
        }
Пример #4
0
        private static void Update()
        {
            var isApplicationActive = InternalEditorUtility.isApplicationActive;

            if (!m_isFocused && isApplicationActive)
            {
                m_isFocused = true;
                OnFocused?.Invoke();
                ;
            }
            else if (m_isFocused && !isApplicationActive)
            {
                m_isFocused = false;
                OnUnfocused?.Invoke();
            }
        }
Пример #5
0
        /// <summary>
        /// Focus the given input focus target.
        /// </summary>
        public override void Focus(IInputFocus target)
        {
            if (target == CurrentInputFocus)
            {
                return;
            }

            CurrentInputFocus = target;
            if (string.IsNullOrEmpty(target.ActionMapName) == false)
            {
                playerInput.SwitchCurrentActionMap(target.ActionMapName);
            }

            target.OnFocus();
            OnFocused?.Invoke(this, new InputFocusEventArgs(target));
        }
Пример #6
0
 /// <summary>
 /// Notifies the focus.
 /// </summary>
 /// <param name="touchPoint">Touch point.</param>
 public void NotifyFocus(Point touchPoint)
 {
     OnFocused?.Invoke(this, touchPoint);
 }
Пример #7
0
 public virtual void Focus()
 {
     Focused = true;
     OnFocused?.Invoke(this);
     Parent?.Focus();
 }
Пример #8
0
 private void Tpanel_Enter(object sender, EventArgs e)
 {
     OnFocused?.Invoke(this);
 }