示例#1
0
 void OnTriggerEnter(Collider collision)
 {
     if (collision.tag == "Player")
     {
         if (SwitchName == "Switch1")
         {
             Door1.SetActive(false);
             GetComponent <Renderer> ().material = switchON;
             switches.Enqueue(1);
             Open.Play();
         }
         if (SwitchName == "Switch2")
         {
             Door2.SetActive(false);
             GetComponent <Renderer> ().material = switchON;
             switches.Enqueue(2);
             Open.Play();
         }
         if (SwitchName == "Switch3")
         {
             Door3.SetActive(false);
             GetComponent <Renderer> ().material = switchON;
             switches.Enqueue(3);
             Open.Play();
         }
     }
 }
示例#2
0
 public void doorBed2Button()
 {
     if (keyBed2Picked)
     {
         ghostRayCol.SetActive(true);
         roomGhost.SetActive(true);
         openBed2Door = true;
         bed2DoorCol.SetActive(false);
         keyIcon.SetActive(false);
         Door3.GetComponent<AudioSource>().PlayOneShot(openingDoor, 1);
     }
     else
     {
         StopCoroutine("bed1Closed");
         StartCoroutine("bed1Closed");
     }
 }
    void Scene3()
    {
        if (back1)
        {
            FinalEmpty[1] = DI_Done2[Random.Range(0, DI_Done2.Length)];
            FinalEmpty[0] = DI_Done1[Random.Range(1, DI_Done1.Length)];
            Guard1_con.SetSeq(FinalEmpty, true);
        }
        else
        {
            Guard1_con.PlaySound(DI_Done1[0], true);
        }

        Door3.GetComponent <Object_Door>().DoorSwitch();
        Guard1_con.SetLookAt(playerHead);
        Guard2_con.StopLookAt();
        Guard2_con.PausePath();

        Check2 = false;
        NextScene.SetActive(true);
    }