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); } }
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); } } }
void OnTriggerExit2D(Collider2D other) { if (qtState == QTState.Done) { qtState = QTState.Ready; qtResponse = QTResponse.Null; } }
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; }
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; } }
// 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); } } }
// 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); } } }
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); } } } }
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; } }
public void DeepMoveOut(int position, QTState state) { quitTimeObj.LeanMoveLocalX(position, 0.3f); slider.Reset(); QTState = state; }