Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     //if the player is in its room, do the furnace's attack
     //if room revealed through telescope, only brighten
     if (Vector3.Distance(
             player.transform.GetChild(0).transform.position,
             transform.position) < 2f)
     {
         //begin to brighten
         Brighten();
         if (!interact.GetInteractType().Equals("telescope"))
         {
             ui.SetInteractText("Hold down [E] to interact");
             interact.SetInteractType("telescope");
         }
         else if (interact.GetCurrentInteractType().Equals(""))
         {
             ui.SetInteractText("Hold down [E] to interact");
         }
         else if (interact.GetCurrentInteractType().Equals("telescope"))
         {
             ui.SetInteractText("");
         }
     }
     else
     {
         Dim();
         ui.SetInteractText("");
         interact.SetInteractType("");
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButton("Interact"))
     {
         if (interact.GetInteractType().Equals("telescope"))
         {
             interact.SetCurrentInteractType("telescope");
             playerCamera.SetFollowMode("telescope");
         }
     }
     else
     {
         interact.SetCurrentInteractType("");
         playerCamera.SetFollowMode("");
     }
 }