예제 #1
0
 // Update is called once per frame
 void Update()
 {
     if (SensorPuzzle)
     {
         foreach (buttonBehavior button in buttons)
         {
             if (fov.showMesh)
             {
                 button.Seen(fov.IsInteractableSeen(button.transform));
             }
             else
             {
                 button.Seen(beamFov.IsInteractableSeen(button.transform));
             }
         }
         if (activeButtonNum == buttons.Count)
         {
             Debug.Log("opening Door");
             if (!door.enabled)
             {
                 GetComponent <AudioSource>().PlayOneShot(doorSound);
             }
             door.enabled = true;
         }
     }
     else if (heatPuzzle)
     {
         if (fov.bulb.power == Bulb.Power.HEAT)
         {
             foreach (ItemBehavior item in items)
             {
                 if (fov.showMesh)
                 {
                     item.Seen(fov.IsInteractableSeen(item.transform));
                 }
                 else
                 {
                     item.Seen(beamFov.IsInteractableSeen(item.transform));
                 }
             }
         }
         else
         {
             foreach (ItemBehavior item in items)
             {
                 item.Seen(false);
             }
         }
     }
     foreach (blacklightMessages message in messages)
     {
         message.Seen(fov.IsInteractableSeen(message.transform));
     }
     if (!dontClear)
     {
         beamFov.Clear();
     }
 }