예제 #1
0
 private void OnTriggerStay(Collider other)
 {
     if (other.name == "Office Trigger")
     {
         inOffice = true;
     }
     if (other.tag == "Player" & angry & !inOffice)
     {
         inOffice = true;
         agent.Warp(new Vector3(10f, 0f, 170f));
         agent.isStopped          = true;
         other.transform.position = new Vector3(10f, 4f, 160f);
         Transform transform = other.transform;
         Vector3   position  = base.transform.position;
         float     x         = position.x;
         Vector3   position2 = other.transform.position;
         float     y         = position2.y;
         Vector3   position3 = base.transform.position;
         transform.LookAt(new Vector3(x, y, position3.z));
         audioQueue.QueueAudio(aud_Delay);
         audioQueue.QueueAudio(audTimes[detentions]);
         audioQueue.QueueAudio(audDetention);
         int num = Mathf.RoundToInt(Random.Range(0f, 2f));
         audioQueue.QueueAudio(audScolds[num]);
         officeDoor.LockDoor((float)lockTime[detentions]);
         baldiScript.Hear(base.transform.position, 5f);
         coolDown = 5f;
         angry    = false;
         detentions++;
         if (detentions > 4)
         {
             detentions = 4;
         }
     }
 }