Ejemplo n.º 1
0
        /// <summary>
        /// Stop to grab
        /// </summary>
        private void EndGrab()
        {
            // unexpected call
            if (!m_isGrabbing || m_selectObj == null)
            {
                return;
            }

            Debug.Log("EndGrab()");
            m_selectObj.OnGrabStop(m_grabInfo.ReleaseRawVelocity);
            m_isGrabbing     = false;
            m_regrabCooldown = REGRAB_COOLDOWN;

            //Jiaju change
            if (m_selectObj)
            {
                Selectable select = m_selectObj.gameObject.GetComponent <Selectable>();
                if (select)
                {
                    select.ResetColliderSizeToOG();
                }
            }
            //Jiaju change end

            m_lastGrabObject = m_selectObj;
            OnRelease(m_selectObj.IsLeftHanded ? m_tLeftHand.Find("palm") : m_tRightHand.Find("palm"), m_selectObj);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Stop to grab
        /// </summary>
        private void EndGrab()
        {
            // unexpected call
            if (!m_isGrabbing || m_selectObj == null)
            {
                return;
            }

            Debug.Log("EndGrab()");
            m_selectObj.OnGrabStop(m_grabInfo.ReleaseRawVelocity);
            m_isGrabbing     = false;
            m_regrabCooldown = REGRAB_COOLDOWN;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Stop to grab
        /// </summary>
        private void EndGrab()
        {
            // unexpected call
            if (!m_isGrabbing || m_selectObj == null)
            {
                return;
            }

            Debug.Log("EndGrab()");
            m_selectObj.OnGrabStop(m_grabInfo.ReleaseRawVelocity);
            m_isGrabbing     = false;
            m_regrabCooldown = REGRAB_COOLDOWN;

            OnRelease(m_selectObj.IsLeftHanded ? m_tLeftHand.Find("palm") : m_tRightHand.Find("palm"), m_selectObj);
            m_lastGrabObject = m_selectObj;
        }