Example #1
0
    private void OnCollisionStay(Collision collision)
    {
        if (collision.collider.tag == "Moveable" && pressing)//OVRInput.Get(OVRInput.Button.One))
        {
            if (!trigger)
            {
                Rigidbody body = collision.collider.GetComponent <Rigidbody>();
                if (body != null)
                {
                    body.isKinematic = true;
                }

                interactChild = collision.collider.transform;
                if (interactChild.parent.GetComponent <HandInteract>() == null)
                {
                    originalParent = interactChild.parent;
                }
                trigger = true;
            }
        }
        else if (collision.collider.tag == "Interactible" && pressing)//OVRInput.Get(OVRInput.Button.One))
        {
            if (!trigger)
            {
                Interactible inter = collision.collider.GetComponent <Interactible>();
                inter.Action(gameObject);
                trigger = true;
            }
        }
    }
Example #2
0
 // Send command to the server to do the interactible object action
 void CmdAction()
 {
     actionableObject.Action();
 }