Пример #1
0
        /// <summary>
        /// Raises the deselect event.
        /// </summary>
        /// <param name="eventData">Event data.</param>
        public override void OnDeselect(BaseEventData eventData)
        {
            // Check if the mouse is over our options list
            if (this.m_ListObject != null)
            {
                UISelectField_List list = this.m_ListObject.GetComponent <UISelectField_List>();

                if (list.IsHighlighted(eventData))
                {
                    return;
                }
            }

            // Check if the mouse is over one of our options
            foreach (UISelectField_Option option in this.m_OptionObjects)
            {
                if (option.IsHighlighted(eventData))
                {
                    return;
                }
            }

            // When the select field loses focus
            // close the list by deactivating the toggle
            this.Close();

            // Pass to base
            base.OnDeselect(eventData);
        }