Exemplo n.º 1
0
    public void DesireAction()
    {
        if (!m_inputEnabled)
        {
            return;
        }

        Grabbable grabbable = GrabbableManager.Instance.GetClosestGrabbableInRadius(this.transform.position, 1.0f);

        if (grabbable != null && grabbable != m_currentGrabbable && grabbable.CanBeGrabbed())
        {
            Grab(grabbable);

            if (m_tutorialGameObject != null)
            {
                m_tutorialGameObject.GetComponent <TutorialText>().enabled = false;
                GameObject.Destroy(m_tutorialGameObject);
                m_tutorialGameObject = null;
            }
        }
        else if (m_currentGrabbable != null)
        {
            Throw(m_currentGrabbable);
            m_currentGrabbable = null;
        }
    }