Ejemplo n.º 1
0
        IEnumerator CheckSingleClick()
        {
            var start    = Time.realtimeSinceStartup;
            var currTime = 0f;

            while (m_SelectIsHeld || currTime < UIUtils.DoubleClickIntervalMax)
            {
                currTime = Time.realtimeSinceStartup - start;
                yield return(null);
            }

            if (m_ClickCount == 1)
            {
                foreach (var inputField in m_InputFields)
                {
                    inputField.CloseKeyboard(m_ClickedField == null);
                }

                if (m_ClickedField)
                {
                    m_ClickedField.OpenKeyboard();
                }
            }

            m_ClickCount = 0;
        }
Ejemplo n.º 2
0
        protected override void OnDragEnded(BaseHandle handle, HandleEventData eventData)
        {
            if (m_DraggedField)
            {
                m_DraggedField.EndSliderDrag(eventData.rayOrigin);
            }

            // Delay call fixes errors when you close the workspace or change data while dragging a field
            EditorApplication.delayCall += () =>
            {
                if (m_DragClone)
                {
                    ObjectUtils.Destroy(m_DragClone.gameObject);
                }
            };

            if (!m_DragObject)
            {
                InputField inputField = null;
                var        fieldBlock = handle.transform.parent;
                foreach (Transform child in fieldBlock.transform)
                {
                    inputField = child.GetComponent <InputField>();
                    if (inputField)
                    {
                        inputField.OpenKeyboard();
                        break;
                    }
                }

                foreach (var field in m_InputFields)
                {
                    field.CloseKeyboard(inputField == null);
                }

                if (inputField)
                {
                    inputField.OpenKeyboard();
                }
            }

            base.OnDragEnded(handle, eventData);
        }