Ejemplo n.º 1
0
    public void HandleOut(Collider _collider)
    {
        if (_collider.gameObject.tag == "GameController")
        {
            return;
        }

        if (!inUse)
        {
            return;
        }

        if (touchedObj == null)
        {
            return;
        }

        if (inStretchMode)
        {
            return;
        }

        if (_collider == touchedObj.GetComponent <Collider> ())
        {
            m_CurrentInteractible.StopTouching(gameObject);
            m_CurrentInteractible = null;
            touchedObj            = null;
        }
    }
Ejemplo n.º 2
0
    public void HandleOut(Collider _collider)
    {
        if (_collider.gameObject.tag == "GameController")
        {
            return;
        }

        if (!inUse)
        {
            return;
        }

        if (touchedObj == null)
        {
            return;
        }

        // comment out???
        if (inStretchMode)
        {
            return;
        }

        if (_collider == touchedObj.GetComponent <Collider> ())
        {
            // checking cuz the parenting(aka non-physics) method will trigger this event for some reason :/
            if (!m_CurrentInteractible.HasRigidbody && grabSomething)
            {
                return;
            }

            // what if it's still grabbing?
            if (grabSomething)
            {
                ExitGrabMode(false);
            }

            //Debug.Log (gameObject.name + " exit touch " + collider.name);
            m_CurrentInteractible.StopTouching(gameObject);
            m_CurrentInteractible = null;
            touchedObj            = null;
        }
    }
Ejemplo n.º 3
0
    private void OnTriggerExit(Collider collider)
    {
        // ignore if it's another controller
        if (collider.gameObject.tag == "GameController")
        {
            return;
        }

        if (touchedObj == null)
        {
            return;
        }

        // what if it's still in stretching mode? => exit stretch mode
        if (inStretchMode && stretchObj == collider.gameObject)
        {
            ExitStretchMode();
        }

        if (collider == touchedObj.GetComponent <Collider> ())
        {
            // due to the parenting(aka non-physics) method will trigger this event for some reason :/
            if (!objHasRigidbody && grabSomething)
            {
                return;
            }

            //DeviceVibrate();

            // what if it's still grabbing?
            if (grabSomething)
            {
                ExitGrabMode(false);
            }

            //Debug.Log (gameObject.name + " exit touch " + collider.name);
            m_CurrentInteractible.StopTouching(gameObject);
            m_CurrentInteractible = null;
            touchedObj            = null;
        }
    }