private IEnumerator CheckCollisionRelease(GameObject handObject, GameObject factoryObject, Interactable currentInteractable) { yield return(null); Interactable handInteractable = Interactable.GetInteractable(handObject.transform); while (MultiColliderTool.CheckCollision(handObject, factoryObject)) { if (currentInteractable != interactable) { handInteractable.DestroyInteractable(); yield break; } if (!handInteractable.IsGrabbed) { handInteractable.DestroyInteractable(); yield break; } yield return(null); } CollisionIgnore.IgnoreCollisions(handObject.transform, factoryObject.transform, false); }
private void OnTriggerExit(Collider other) { GameObject gm = Interactable.GetInteractableObject(other.transform); if (gm == null) { return; } GeneralItem item = gm.GetComponent <GeneralItem>(); if (item == null) { return; } if (MultiColliderTool.CheckCollision(gameObject, item.gameObject)) { return; } //Events.FireEvent(EventType.ItemDroppedOnFloor, CallbackData.Object(item)); item.DestroyInteractable(); }