|
@ -3,8 +3,8 @@ using System.Collections; |
|
|
|
|
|
|
|
|
public class EndCamera : MonoBehaviour { |
|
|
public class EndCamera : MonoBehaviour { |
|
|
|
|
|
|
|
|
public GameObject camera; |
|
|
|
|
|
public MonoBehaviour script; |
|
|
public MonoBehaviour script; |
|
|
|
|
|
public float waitTime; |
|
|
|
|
|
|
|
|
// Use this for initialization
|
|
|
// Use this for initialization
|
|
|
void Start () { |
|
|
void Start () { |
|
@ -19,6 +19,12 @@ public class EndCamera : MonoBehaviour { |
|
|
void OnTriggerEnter(Collider other) { |
|
|
void OnTriggerEnter(Collider other) { |
|
|
if (other.transform.tag == "moveable") { |
|
|
if (other.transform.tag == "moveable") { |
|
|
script.enabled = false; |
|
|
script.enabled = false; |
|
|
|
|
|
StartCoroutine(wait()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
IEnumerator wait() { |
|
|
|
|
|
yield return new WaitForSeconds(waitTime); |
|
|
|
|
|
Application.LoadLevel ("TitleScreen"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |