1
0
Fork 0
Bildschirmflausch-LD41/Assets/Scripts/Door.cs

31 lines
567 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Door : MonoBehaviour {
private bool locked = false;
BoxCollider2D boundingBox;
// Use this for initialization
void Start () {
boundingBox = GetComponent<BoxCollider2D>();
Unlock();
}
public void Lock()
{
locked = true;
boundingBox.enabled = true;
}
public void Unlock()
{
locked = false;
boundingBox.enabled = false;
}
public bool IsLocked()
{
return locked;
}
}