/// <summary> /// Activates first button in stack and changes color to active color /// </summary> protected void activateButton() { //Set active button to first button in stack activeButton = buttonStack[listIndex % 3]; //Make sure it is active activeButton.Active = true; // Set the matching chevron to visible and white. HackDialogChevrons[listIndex % 3].color = new Color32(0xff, 0xff, 0xff, 0xff); //begin listening again listening = true; }
public void StartQTE() { Debug.Log("StartQTE called"); player.GetComponent <PlayerMovement>().moveSwitch = false; qteTriggered = true; GameObject qtePrefab = Resources.Load("Prefabs/QTEButton") as GameObject; GameObject qte = Instantiate(qtePrefab, canvas.transform.position, Quaternion.identity, canvas.transform); QTEButton qtebutton = qte.GetComponent <QTEButton>(); qtebutton.correctEvent += () => { QteCorrect(1); }; qtebutton.falseEvent += () => { QteFail(1); }; qtebutton.StartQte(); Time.timeScale = 0; }
private void QteCorrect(int i) { Debug.Log("QTE " + i + " Succeeded!"); if (i == 3) { GameManager.save.flags["S1F2"] = true; StartCoroutine(ToScene2()); return; } Destroy(GameObject.Find("Police" + i)); GameObject qtePrefab = Resources.Load("Prefabs/QTEButton") as GameObject; GameObject qte = Instantiate(qtePrefab, canvas.transform.position, Quaternion.identity, canvas.transform); QTEButton qtebutton = qte.GetComponent <QTEButton>(); qtebutton.correctEvent += () => { QteCorrect(i + 1); }; qtebutton.falseEvent += () => { QteFail(i + 1); }; qtebutton.StartQte(); }