IEnumerator CloseInteractionCamera(InteractionObject obj, GameObject currentInspectedObject) { Coroutine rotateCoroutine = null; if (currentInspectedObject != null) rotateCoroutine = StartCoroutine(RotateObjectCoroutine(currentInspectedObject, obj)); var conversationManager = FindObjectOfType<ConversationManager>(); while (dialog.IsDisplaying() || conversationManager.IsInProgress) yield return null; if(rotateCoroutine != null) StopCoroutine(rotateCoroutine); camera.enabled = false; cameraGrayscale.effectAmount = 0; if (obj.disableAfterUse) obj.isUseable = false; // Run world behaviors resulting from interaction obj.onInteractionEnd.Invoke(obj); Destroy(currentInspectedObject); if (obj.deleteAfterUse) Destroy(obj.gameObject); obj.PutDown(); }