You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
586 B

9 years ago
9 years ago
9 years ago
9 years ago
  1. using UnityEngine;
  2. using System.Collections;
  3. public class EndCamera : MonoBehaviour {
  4. public MonoBehaviour script;
  5. public float waitTime;
  6. // Use this for initialization
  7. void Start () {
  8. //script = camera.GetComponent("Smooth Follow") as MonoBehaviour;
  9. }
  10. // Update is called once per frame
  11. void Update () {
  12. }
  13. void OnTriggerEnter(Collider other) {
  14. if (other.transform.tag == "moveable") {
  15. script.enabled = false;
  16. StartCoroutine(wait());
  17. }
  18. }
  19. IEnumerator wait() {
  20. yield return new WaitForSeconds(waitTime);
  21. Application.LoadLevel ("TitleScreen");
  22. }
  23. }