private void Awake() //setting up singleton { if (instance == null) { instance = this; } else if (instance != this) { Debug.Log("Instance already exists, destroying object!"); Destroy(this); } }
public void Unlock() { if (door.IsLocked) { if (PlayerState.instance.items[5] == true) { BlackoutManager bom = transform.GetComponent <BlackoutManager>(); bom.FadeOut(); door.IsLocked = false; door.Open(); Invoke("End", 2f); } } }