public void IgnoreGrabbableCollisions(Grabbable grab, bool ignorePhysics) { var grabColliders = grab.GetComponentsInChildren<Collider>(); // Ignore all other hand collider for (int x = 0; x < grabColliders.Length; x++) { Collider thisGrabCollider = grabColliders[x]; for (int y = 0; y < handColliders.Count; y++) { Physics.IgnoreCollision(thisGrabCollider, handColliders[y], ignorePhysics); } } }
void disableGrabbable(Grabbable grab) { if (DisableColliders) { disabledColliders = grab.GetComponentsInChildren <Collider>(false).ToList(); for (int x = 0; x < disabledColliders.Count; x++) { disabledColliders[x].enabled = false; } } // Disable the grabbable. This is picked up through a Grab Action grab.enabled = false; }
void disableGrabbable(Grabbable grab) { if (DisableColliders) { disabledColliders = grab.GetComponentsInChildren <Collider>(false).ToList(); foreach (var c in disabledColliders) { c.enabled = false; } } // Disable the grabbable. This is picked up through a Grab Action grab.enabled = false; }
public void AutoPopulateGrabPoints() { if (grabbable) { var newPoints = new List <Transform>(); foreach (var gp in grabbable.GetComponentsInChildren <GrabPoint>()) { if (gp != null && gp.gameObject.activeInHierarchy) { newPoints.Add(gp.transform); } } grabbable.GrabPoints = newPoints; } }