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 {
|
||||
private bool locked = false;
|
||||
|
||||
BoxCollider2D boundingBox;
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
locked = false;
|
||||
boundingBox = GetComponent<BoxCollider2D>();
|
||||
Unlock();
|
||||
}
|
||||
|
||||
public void Lock()
|
||||
{
|
||||
locked = true;
|
||||
boundingBox.enabled = true;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
locked = false;
|
||||
boundingBox.enabled = false;
|
||||
}
|
||||
|
||||
public bool IsLocked()
|
||||
|
|
Loading…
Add table
Reference in a new issue