public void process(float segs) { if (possibleObject != null && allowToGrab && !objectInHand) { voObject = possibleObject; possibleObject = null; StartCoroutine(setHand(false, segs)); // hand.setDraw(false); objectInHand = true; } else if (voObject != null) { trackerMannager.fLeftTracker.detach(); trackerMannager.fRightTracker.detach(); possibleObject = voObject; voObject = null; //hand.setDraw(true); StartCoroutine(setHand(true, segs)); objectInHand = false; PropSpecs propSpecs = possibleObject.GetComponent <PropSpecs>(); propSpecs.objectGrabbed(false); propSpecs.objectGreen(false); } }
private void OnTriggerExit(Collider other) { if (possibleObject != null) { PropSpecs propSpecs = possibleObject.GetComponent <PropSpecs>(); propSpecs.objectGreen(false); propSpecs.objectGrabbed(false); possibleObject = null; } }
private void OnTriggerEnter(Collider other) { if (allowToGrab && !objectInHand) { GameObject possibleObjectT = other.gameObject; PropSpecs propSpecs = possibleObjectT.GetComponent <PropSpecs>(); if (propSpecs != null && !propSpecs.grabbed) { propSpecs.objectGrabbed(true); propSpecs.objectGreen(true); possibleObject = possibleObjectT; } } }