示例#1
0
        public static void Select(IInteractableComponent button)
        {
            if (button != null)
            {
                var sel = button.GetSelectable();
                if (sel != null)
                {
                    if (button.IsVisible() == false)
                    {
                        var buttonBase = (button as WindowComponentBase);

                        System.Action callback = null;
                        callback = () => {
                            WindowSystem.GetEvents().Unregister(buttonBase, WindowEventType.OnShowEnd, callback);
                            WindowSystemInput.Select_INTERNAL(button);
                        };

                        WindowSystem.GetEvents().Register(buttonBase, WindowEventType.OnShowEnd, callback);
                    }
                    else
                    {
                        WindowSystemInput.Select_INTERNAL(button);
                    }
                }
            }
        }
		public static void Select(IInteractableComponent button) {

			if (button != null) {

				var sel = button.GetSelectable();
				if (sel != null) sel.Select();

			}

		}
示例#3
0
 public static void Deselect(IInteractableComponent button)
 {
     if (button != null)
     {
         var sel = button.GetSelectable();
         if (sel != null)
         {
             sel.OnDeselect(null);
         }
     }
 }
示例#4
0
 public static void Deselect(IInteractableComponent button)
 {
     if (button != null)
     {
         var sel = button.GetSelectable();
         if (sel != null)
         {
             if (EventSystem.current.currentSelectedGameObject == sel.gameObject)
             {
                 EventSystem.current.SetSelectedGameObject(null);
             }
         }
     }
 }
示例#5
0
        private static void Select_INTERNAL(IInteractableComponent button)
        {
            var sel = button.GetSelectable();

            if (sel != null)
            {
                WindowSystemInput.Deselect(button);
                sel.Select();
                if (sel is ButtonExtended)
                {
                    (sel as ButtonExtended).Select(forced: true);
                }
            }
        }