Commit 7a0183b5 authored by Ashley's avatar Ashley

Completed DoorSceneScript

parent 6321c0fd
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class DoorSceneScript : MonoBehaviour {
public class DoorSceneScript : DoorScript {
// Use this for initialization
// Use this for initialization
public string nextScene;
void Start () {
}
......@@ -12,4 +14,13 @@ public class DoorSceneScript : MonoBehaviour {
void Update () {
}
void OnCollisionEnter2D(Collision2D coll)
{
base.OnCollisionEnter2D(coll);
if(state == State.open)
{
SceneManager.LoadScene(nextScene);
}
}
}
......@@ -48,7 +48,7 @@ public class DoorScript : MonoBehaviour {
Debug.Log("Door Unlocked");
}
void OnCollisionEnter2D(Collision2D coll)
public void OnCollisionEnter2D(Collision2D coll)
{
if(coll.gameObject.tag == "Player")
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment