public override void Interact() { if (requiredKey == null || (inventory.GetEquipped() != null && inventory.GetEquipped().itemName == requiredKey.itemName)) { link.MoveToSpawnPosition(); audioSource.clip = AudioManager.instance.door; audioSource.Play(); } }
// Use this for initialization private void Awake() { PauseGame(false); instance = this; spawnPoint.MoveToSpawnPosition(); Item[] allItems = FindObjectsOfType <Item>(); foreach (Item i in allItems) { if (GetItem(i.itemName) == null) { //Make a copy of the item, so there is always one even if the item found is destroyed. Item newItem = Instantiate(i); newItem.gameObject.SetActive(false); items.Add(newItem); } } }