예제 #1
0
 private void PatternFail()
 {
     HideGammeplayImages();
     actualState   = InputGameplayState.MSG;
     imgMSG.sprite = FailSprite;
     imgMSG.color  = new Color(200, 0, 0);
     imgMSG.gameObject.SetActive(true);
     StartCoroutine(EndMSG());
 }
예제 #2
0
 private void PatternOK()
 {
     HideGammeplayImages();
     actualState   = InputGameplayState.MSG;
     imgMSG.sprite = OkSprite;
     imgMSG.color  = new Color(0, 200, 0);
     imgMSG.gameObject.SetActive(true);
     //timeToComplete = TimeMinToComplete + patternActual;
     StartCoroutine(EndMSG());
 }
예제 #3
0
    IEnumerator EndMSG()
    {
        yield return(new WaitForSeconds(1f));

        imgInput.gameObject.SetActive(false);
        imgMSG.gameObject.SetActive(false);
        GeneratePattern();
        inputs = new List <directions>();
        timeToCompleteCounter = 0;
        actualState           = InputGameplayState.GAME;
        yield return(null);
    }
예제 #4
0
    public void StartGame()
    {
        HideGammeplayImages();
        pattern = new List <directions>();
        inputs  = new List <directions>();

        imgMSG.gameObject.SetActive(false);
        imgInput.gameObject.SetActive(false);
        timeToComplete        = TimeMinToComplete;
        patternActual         = 0;
        timeToCompleteCounter = 0;
        GeneratePattern();
        actualState = InputGameplayState.GAME;
    }
예제 #5
0
    public void InputArrow(directions dir)
    {
        if (actualState != InputGameplayState.GAME)
        {
            return;
        }

        imgInput.sprite = GetIcon(dir);
        imgInput.gameObject.SetActive(true);

        inputs.Add(dir);

        if (dir != pattern[inputs.Count - 1])
        {
            patternActual = 0;
            SFXManager.SharedInstance.PlaySFX(SFXType.SoundType.ERROR);
            PatternFail();
            return;
        }

        if (inputs.Count == pattern.Count)
        {
            patternActual++;

            SFXManager.SharedInstance.PlaySFX(SFXType.SoundType.CORRECT);

            if (patternActual >= CantPatterns.Count)
            {
                actualState = InputGameplayState.END;
                HideGammeplayImages();
                imgMSG.sprite = QuestionSprite;
                imgMSG.color  = new Color(0, 155, 255);
                imgMSG.gameObject.SetActive(true);
                triviaGameplayManager.StartGame();
            }
            else
            {
                PatternOK();
            }
        }
    }