Example #1
0
    private void OnTriggerExit(Collider other)
    {
        //if (m_penCork && (other.gameObject == m_penCork.gameObject))
        //{
        //    StopCoroutine(PutCorkCoroutine());

        //    m_penCork.transform.SetParent(null);
        //    m_penCork.rigidbody.isKinematic = false;
        //    m_penCork.rigidbody.useGravity = true;
        //    m_penCork.GetComponent<Collider>().isTrigger = false;

        //    m_penCork = null;
        //}

        if (!m_corkPosition)
        {
            return;
        }

        ViveCork viveCork = other.GetComponent <ViveCork>();

        if (viveCork)
        {
            if (!viveCork.picked)
            {
                viveCork.Release();
            }
            else
            {
                viveCork.CancelAttach();
            }
            m_hasCork = false;
            //PlayPopSound(m_openingSound);
        }
    }
Example #2
0
    private void OnTriggerExit(Collider other)
    {
        if (!m_corkPosition)
        {
            return;
        }

        ViveCork viveCork = other.GetComponent <ViveCork>();

        if (viveCork && hasCork)
        {
            if (!viveCork.picked)
            {
                viveCork.Release();
            }
            else
            {
                viveCork.CancelAttach();
            }
            m_fluwidManager.flowBlocked = false;
            m_viveCork = null;
            PlayPopSound(m_closingSound);
        }
    }