Ejemplo n.º 1
0
    private IEnumerator StateChange()
    {
        qtState = QTState.Delay;

        // Wait for the Delay if any delay at all.
        yield return(new WaitForSeconds(DelayTimer));

        // This line below is only for Debug Purposes
        Debug.Log(QTEButton.ToString());

        // Shrink the QTE Button
        StartCoroutine(ScaleOverTime(CountTimer));

        qtState = QTState.Ongoing;
        yield return(new WaitForSeconds(CountTimer));

        // If the timer is over and the event isn't over? Fix it! because most likely they failed.
        if (qtState == QTState.Ongoing)
        {
            qtResponse = QTResponse.Fail;
            qtState    = QTState.Done;

            flowChart.ExecuteBlock(blockWhenFailed);
        }
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            // succeed QTE (press right button)
            if (
                (QTEButton == Action.punch && characterActions.Punch) ||
                (QTEButton == Action.kick && characterActions.Kick)
                )
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;

                if (System.String.IsNullOrEmpty(blockWhenSuccess))
                {
                    Continue();
                }
                else
                {
                    flowChart.ExecuteBlock(blockWhenSuccess);
                }
            }

            // fail QTE (press wrong button)
            if (
                (QTEButton == Action.punch && characterActions.Kick) ||
                (QTEButton == Action.kick && characterActions.Punch)
                )
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Fail;
                flowChart.ExecuteBlock(blockWhenFailed);
            }
        }
    }
Ejemplo n.º 3
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (qtState == QTState.Done)
     {
         qtState    = QTState.Ready;
         qtResponse = QTResponse.Null;
     }
 }
Ejemplo n.º 4
0
 public void SetQTEventIN(string _sliderText, int _sliderTime, float _sliderTimeMultiplier, QTState _qtState)
 {
     slider.Settext(_sliderText);
     slider.globalTime = _sliderTime;
     slider.multiplier = _sliderTimeMultiplier;
     qtObjectMoveCenter(0.2f);
     QTState = _qtState;
 }
Ejemplo n.º 5
0
    private IEnumerator StateChange()
    {
        qtState = QTState.Ongoing;
        yield return(new WaitForSeconds(CountTimer));

        // If the timer is over and the event isn't over? Fix it! because most likely they failed.
        if (qtState == QTState.Ongoing)
        {
            qtResponse = QTResponse.Fail;
        }
    }
Ejemplo n.º 6
0
    // Update is called once per frame
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            if (Input.anyKeyDown)                                   //we press ANY key during the OnGoing state
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;

                DisplayBox.GetComponent <Text>().text = "WIN";
                //PassBox.GetComponent<Text>().text = "WIN";
                StopCoroutine(StateChange());
                gameManager.EndGame(IMiniGame.MiniGameResult.WIN);
            }
        }
    }
Ejemplo n.º 7
0
    // Update is called once per frame
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            if (InputManager.Instance.GetButton(InputManager.MiniGameButtons.BUTTON1))                                 //we press ANY key during the OnGoing state
            {
                anim.SetTrigger("jumptrigger");


                DisplayBox.GetComponent <Text>().text = "WIN";
                //PassBox.GetComponent<Text>().text = "WIN";
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;
                StopCoroutine(StateChange());
                gameManager.EndGame(IMiniGame.MiniGameResult.WIN);
            }
        }
    }
Ejemplo n.º 8
0
    void Update()
    {
        if (qtState == QTState.Ongoing)
        {
            if (Input.GetKeyDown(QTEButton))
            {
                qtState    = QTState.Done;
                qtResponse = QTResponse.Success;

                if (System.String.IsNullOrEmpty(blockWhenSuccess))
                {
                    Continue();
                }
                else
                {
                    flowChart.ExecuteBlock(blockWhenSuccess);
                }
            }
        }
    }
Ejemplo n.º 9
0
    private IEnumerator StateChange()
    {
        qtState = QTState.Delay;
        yield return(new WaitForSeconds(DelayTimer));                     // Wait for the Delay

        DisplayBox.GetComponent <Text>().text = "QUICK! PRESS A BUTTON!"; //shows text to JUMP
        soundAudio.clip = alarm;
        soundAudio.Play();
        EnemyIMG.SetActive(true);
        qtState = QTState.Ongoing;
        yield return(new WaitForSeconds(CountTimer));

        if (qtState == QTState.Ongoing)                             //count.timer gets to 0
        {
            qtResponse = QTResponse.Fail;
            //PassBox.GetComponent<Text>().text = "FAIL";
            gameManager.EndGame(IMiniGame.MiniGameResult.LOSE);
            qtState = QTState.Done;
            DisplayBox.GetComponent <Text>().text = string.Empty;
        }
    }
Ejemplo n.º 10
0
 public void DeepMoveOut(int position, QTState state)
 {
     quitTimeObj.LeanMoveLocalX(position, 0.3f);
     slider.Reset();
     QTState = state;
 }