Ejemplo n.º 1
0
 private void Awake()    //setting up singleton
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Debug.Log("Instance already exists, destroying object!");
         Destroy(this);
     }
 }
Ejemplo n.º 2
0
 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);
         }
     }
 }