public void AddItem(string itemName) { dispenserInventory.gameObject.SetActive(true); IInventoryItem newItem = dispenserInventory.AddItem(itemName); if (!inventoryScript.inventory.CanAdd(newItem)) { Debug.Log("Outta room!!!"); dialogueRunnerScript.startNode = "Ending.NoRoom"; dialogueRunnerScript.StartDialogue(); } }
IEnumerator RunTimer() { Debug.Log("Running timer"); timerSlider.value = timerSlider.maxValue; while (timerSlider.value > 0) { yield return(new WaitForSeconds(0.25f)); timerSlider.value -= 0.25f; } inventoryScript.AddItem("Lie_No"); timerSlider.gameObject.SetActive(false); timerCoroutine = null; }