1
0
Fork 0

add change of collision for door, moved player to prefab

This commit is contained in:
Jan 2018-04-21 16:24:58 +02:00
parent fc39fd726b
commit eb8786a30a
3 changed files with 6 additions and 1 deletions

View file

@ -4,19 +4,24 @@ using UnityEngine;
public class Door : MonoBehaviour { public class Door : MonoBehaviour {
private bool locked = false; private bool locked = false;
BoxCollider2D boundingBox;
// Use this for initialization // Use this for initialization
void Start () { void Start () {
locked = false; boundingBox = GetComponent<BoxCollider2D>();
Unlock();
} }
public void Lock() public void Lock()
{ {
locked = true; locked = true;
boundingBox.enabled = true;
} }
public void Unlock() public void Unlock()
{ {
locked = false; locked = false;
boundingBox.enabled = false;
} }
public bool IsLocked() public bool IsLocked()