// Use this for initialization IEnumerator Start() { show = GetComponent <Slideshow>(); mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); txt = mainCamera.GetComponentInChildren <Text>(); yield return(new WaitForSeconds(0.5f)); show.ShowCutscene(); StartCoroutine("Checker"); StartCoroutine("Writer"); finishedWrite = false; finishedMov = false; }
public void NextCheckpoint(GameObject checkpoint) { for (int i = currentCheckpoint + 1; i < checkpoints.Count; ++i) { if (checkpoints[i] == checkpoint) { Slideshow checkpointSlideshow = checkpoint.GetComponent <Slideshow>(); if (checkpointSlideshow) { checkpointSlideshow.ShowCutscene(); } currentCheckpoint = i; Instantiate(flag, checkpoint.transform.position, checkpoint.transform.rotation).transform.Translate(new Vector3(0, 0, 1)); if (i == checkpoints.Count - 1) { StartCoroutine(BackToMenu()); } } } }