private void ClearSceneRoom02() { Item oarItem = Resources.Load <Item>("ScriptableObjects/Oar"); Item pipeItem = Resources.Load <Item>("ScriptableObjects/LoosePipe"); List <DroppedItem> listAllDroppedItemsInScene = FindObjectsOfType <DroppedItem>().ToList(); DroppedItem paddleDroppedItem = listAllDroppedItemsInScene.FirstOrDefault(i => i.Item == oarItem); if (paddleDroppedItem) { paddleDroppedItem.Interact(null); } DroppedItem droppedPipe = listAllDroppedItemsInScene.FirstOrDefault(i => i.Item == pipeItem); if (droppedPipe) { droppedPipe.Interact(null); Inventory.RemoveItem(droppedPipe.Item); } InteractableThatNeedsItem fixedPipe = FindObjectOfType <InteractableThatNeedsItem>(); if (fixedPipe) { fixedPipe.Interact(pipeItem); } MorsecodeMachinePopup machinePopup = FindObjectOfType <MorsecodeMachinePopup>(); if (machinePopup) { machinePopup.UITextSend.text = machinePopup.MorsecodeSendMessage; StartCoroutine(machinePopup.CheckMorseMessage()); } }
public void Awake() { _morsecodeMachinePopup = transform.parent.parent.gameObject.GetComponent <MorsecodeMachinePopup>(); }