Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
 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);
 }