add change of collision for door, moved player to prefab
This commit is contained in:
parent
fc39fd726b
commit
eb8786a30a
3 changed files with 6 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Add table
Reference in a new issue