DoorSceneScript.cs 475 Bytes
Newer Older
1 2
using UnityEngine;
using System.Collections;
Ashley's avatar
Ashley committed
3
using UnityEngine.SceneManagement;
4

Ashley's avatar
Ashley committed
5
public class DoorSceneScript : DoorScript {
6

Ashley's avatar
Ashley committed
7 8
    // Use this for initialization
    public string nextScene;
9 10 11 12 13 14 15 16
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
Ashley's avatar
Ashley committed
17 18 19 20 21 22 23 24 25

    void OnCollisionEnter2D(Collision2D coll)
    {
        base.OnCollisionEnter2D(coll);
        if(state == State.open)
        {
            SceneManager.LoadScene(nextScene);
        }
    }
26
}