private void OnTriggerExit(Collider other) { InterractibleObject interractibleObject = other.gameObject.GetComponentInChildren <InterractibleObject>(); if (interractibleObject != null && interractibleObjects.Contains(other.gameObject)) { interractibleObjects.Remove(other.gameObject); } }
private void OnTriggerEnter(Collider other) { InterractibleObject interractibleObject = other.gameObject.GetComponentInChildren <InterractibleObject>(); if (interractibleObject != null) { interractibleObjects.Add(other.gameObject); } }
public void TerminateInterraction() { if (interractibleObjects != null && interractibleObjects.Count > 0) { foreach (GameObject interractibleObject in interractibleObjects) { if (interractibleObject != null) { InterractibleObject interractible = interractibleObject.GetComponentInChildren <InterractibleObject>(); if (IsDroppableViaParenting(interractible)) { DropViaParenting(interractibleObject); } else if (IsDroppableViaJoint(interractible)) { DropViaJoint(interractibleObject); } } } } }
private bool IsDroppableViaJoint(InterractibleObject interractible) { return(interractible.interractibleObjectAttatchMethod == InterractibleObjectAttatchMethods.JOINT && interractible.interractibleObjectActions != null && interractible.interractibleObjectActions.Contains(InterractibleObjectActions.DROP)); }
private bool IsGrabbableViaParenting(InterractibleObject interractible) { return(interractible.interractibleObjectAttatchMethod == InterractibleObjectAttatchMethods.PARENT && interractible.interractibleObjectActions != null && interractible.interractibleObjectActions.Contains(InterractibleObjectActions.GRAB)); }