Example #1
0
    public void validateInput()
    {
        if (MissionManager.instance.inExePuzzle)
        {
            if (keycode == 95 && ep.stepID == 1)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 18 && ep.stepID == 2)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 19 && ep.stepID == 3)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 260 && ep.stepID == 4)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 270 && ep.stepID == 5)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 280 && ep.stepID == 6)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 450 && ep.stepID == 7)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 860 && ep.stepID == 8)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 870 && ep.stepID == 9)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 850 && ep.stepID == 10)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }
            else if (keycode == 461 && ep.stepID == 11)
            {
                ep.nextStep = true;
                StartCoroutine(lightFlashKeys(Color.green, true));
            }

            else
            {
                ep.StopPuzzle();
            }
        }
        else
        {
            if (keyPadValidation(keycode))
            {
                foreach (GameObject btn in keyButtons)
                {
                    btn.GetComponent <digicodeBtn>().clicked = false;
                }
            }
            else
            {
                foreach (GameObject btn in keyButtons)
                {
                    btn.GetComponent <digicodeBtn>().clicked = false;
                }
                StartCoroutine(flashKeys(Color.red, true));
            }
        }
    }
Example #2
0
    public void ComfirmInput()
    {
        if (!MissionManager.instance.inExePuzzle)
        {
            if (MissionManager.instance.ValidateKeypadCode(keyPressed) == true)
            {
                foreach (GameObject btn in keyButtons)
                {
                    btn.GetComponent <keyBtn>().clicked = false;
                }
                if (GameManager.instance.flashKeypad)
                {
                    StartCoroutine(flashKeys(Color.green, true));
                }
                else
                {
                    StartCoroutine(flashKeys(Color.green, false));
                }
                AudioManager.instance.PlaySound("digiOkSound");
                MissionManager.instance.keyPadCorrect = true;
            }
            else
            {
                foreach (GameObject btn in keyButtons)
                {
                    btn.GetComponent <keyBtn>().clicked = false;
                }
                AudioManager.instance.PlaySound("digiError");
                StartCoroutine(flashKeys(Color.red, true));
            }
        }
        else if (MissionManager.instance.inExePuzzle)
        {
            if (ep.puzzleOk)
            {
                foreach (GameObject btn in keyButtons)
                {
                    btn.GetComponent <keyBtn>().clicked = false;
                }
                if (GameManager.instance.flashKeypad)
                {
                    StartCoroutine(lightFlashKeys(Color.green, true));
                }
                else
                {
                    StartCoroutine(flashKeys(Color.green, false));
                }

                ep.nextStep = true;
            }
            else if (ep.puzzleDone)
            {
                foreach (GameObject btn in keyButtons)
                {
                    btn.GetComponent <keyBtn>().clicked = false;
                }
                if (GameManager.instance.flashKeypad)
                {
                    StartCoroutine(flashKeys(Color.green, true));
                }
                else
                {
                    StartCoroutine(flashKeys(Color.green, false));
                }
                AudioManager.instance.PlaySound("digiOkSound");
            }
            else
            {
                foreach (GameObject btn in keyButtons)
                {
                    btn.GetComponent <keyBtn>().clicked = false;
                }
                ep.StopPuzzle();
            }
        }
    }