Пример #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Frisbee")
     {
         // Resets the frisbee and places it back in hand
         Frisbee frisbee = other.GetComponent <Frisbee>();
         if (frisbee)
         {
             frisbee.OnReset();
             frisbee.m_frisbeeRelease.PlaceInHand();
         }
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if ((m_inHand && OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger)) || (m_inHand && m_test))
        {
            Release();
        }
        else if ((!m_inHand && OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger)) || (!m_inHand && m_test))
        {
            PlaceInHand();
            m_frisbee.OnReset();
        }

        m_lastPos = m_frisbee.transform.position;
    }