public override void Action(GameObject obj)
    {
        GameObject doc = Instantiate(documentPrefab);

        doc.transform.position = obj.transform.position;
        doc.transform.rotation = Quaternion.LookRotation(Camera.main.transform.forward);
        //doc.transform.Rotate(90, 0, 0);
        //doc.transform.Rotate(0, 180, 0);
        doc.transform.Rotate(rotateSpawnOffset);
        doc.GetComponent <Rigidbody>().isKinematic = true;
        doc.SetActive(true);
        Deleteable del = doc.GetComponent <Deleteable>();

        if (del.deleteCollection == null)
        {
            del.deleteCollection = deleteCollection;
        }

        HandInteract hand = obj.GetComponent <HandInteract>();

        if (hand)
        {
            hand.interactChild = doc.transform;
            //hand.originalParent = null;
        }

        HandState handState = obj.GetComponent <HandState>();

        if (hand)
        {
            doc.transform.parent = hand.transform;
            doc.GetComponent <ObjectOutline>().outline.SetActive(false);
        }
    }
Example #2
0
 void Start()
 {
     countDrops   = 5;
     active       = false;
     handInteract = GetComponent <HandInteract>();
 }
Example #3
0
 private void Awake()
 {
     //m_grabber = GetComponent<OVRGrabber>();
     grabber = GetComponent <HandInteract>();
 }
Example #4
0
    //private List<Collider> organoids = new List<Collider>();

    private void Start()
    {
        handInteract = GetComponent <HandInteract>();
    }