Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnCollisionEnter2D(Collision2D col){
- if (col.gameObject.tag == "Enemy") {
- score = score + 50;
- Destroy (gameObject);
- *Here I need to wait for 3 sec then it should load the next level*
- SceneManager.LoadScene(nextLevel);
- void OnCollisionEnter2D(Collision2D col){
- Debug.Log ("Collision");
- if (col.gameObject.tag == "Enemy") {
- score = score + 50;
- Destroy (gameObject);
- StartCoroutine (WaitForIt (3.0F));
- IEnumerator WaitForIt(float waitTime) {
- yield return new WaitForSeconds(waitTime);
- SceneManager.LoadScene(nextLevel);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement