public void VerifyCombination() { ItemSlot[] slots = combinationPanel.Slots; for (int i = 0; i < slots.Length; i++) { if (slots[i].SlotImage.Image.enabled == false || slots[i].SlotImage.MyCollectable.ID != selectedNumbers[i]) { StartCoroutine(ChangePanelColor(Color.red)); combinationPanel.TriggerWrongCombination(); FindObjectOfType <AudioManager>().Play("RuneWrong"); return; } } StartCoroutine(ChangePanelColor(Color.green)); FindObjectOfType <AudioManager>().Play("RuneRight"); StartCoroutine(exitDoor.OpenDoorsWithDelay(0.5f)); combinationPanel.ClosePanel(0.5f); }
public void VerifyCombination() { if (combinationPanel.Slots[0].GetIsFree()) { StartCoroutine(ChangePanelColor(Color.red)); combinationPanel.TriggerWrongCombination(); return; } if (combinationPanel.Slots[0].SlotImage.MyCollectable.ID != winnerLockerIndex) { combinationPanel.Slots[0].RemoveImage(); StartCoroutine(ChangePanelColor(Color.red)); combinationPanel.TriggerWrongCombination(); FindObjectOfType <AudioManager>().Play("TotemWrong"); return; } StartCoroutine(ChangePanelColor(Color.green)); FindObjectOfType <AudioManager>().Play("TotemConfirm"); StartCoroutine(exitDoor.OpenDoorsWithDelay(0.5f)); combinationPanel.ClosePanel(0.5f); }