Beispiel #1
0
 private void OnMouseOver()
 {
     if (Vector3.Distance(transform.position, player.transform.position) < 5)
     {
         if (playerItemScript.GetHasItem() == false || itemAccepted)
         {
             displayTextScript.SetEnabled(false);
         }
         else
         {
             displayTextScript.SetEnabled(true);
             playerItemScript.AllowDroppingItems(false);
             if (playerItemScript.GetHeldObject().name == itemToAccept.name && Input.GetKeyDown(KeyCode.E))
             {
                 playerItemScript.DisableItemOnPedestal();
                 playerItemScript.GetItemPlace(itemPlace);
                 playerItemScript.TriggerAnimPlace();
                 itemAccepted = true;
                 m_MyAudioSource.Play();
                 if (doorManagerScript != null)
                 {
                     doorManagerScript.CheckWinCondition();
                 }
                 else if (gateManagerScript != null)
                 {
                     gateManagerScript.OpenGate();
                 }
                 else
                 {
                     Debug.Log(gameObject.name + " is missing door reference");
                 }
             }
         }
     }
 }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     if (OPENVARANTSER)
     {
         OPENVARANTSER = false;
         openGate      = true;
         displayTextScript.SetEnabled(false);
         leverAnim.SetTrigger("leverDown");
     }
 }
Beispiel #3
0
 private void OnMouseOver()
 {
     if (Vector3.Distance(transform.position, player.transform.position) < 5)
     {
         if (Input.GetKeyDown(KeyCode.E) && !openChest)
         {
             openChest = true;
             displayTextScript.SetEnabled(false);
             animChest.SetTrigger("openChest");
             m_MyAudioSource.Play();
         }
     }
 }
Beispiel #4
0
 private void OnMouseOver()
 {
     if (Vector3.Distance(transform.position, player.transform.position) < 5)
     {
         if (playerItemScript.GetHeldObject().CompareTag("Key"))
         {
             displayTextScript.SetText("Press E to unlock");
         }
         if (Input.GetKeyDown(KeyCode.E) && !openChest && playerItemScript.GetHeldObject().CompareTag("Key"))
         {
             openChest = true;
             displayTextScript.SetEnabled(false);
             animChest.SetTrigger("openChest");
             playerItemScript.DestroyKey();
             m_MyAudioSource.Play();
         }
     }
 }
Beispiel #5
0
 //When placed on pedestal should no longer be able to pickup
 public void SetIsPlaced()
 {
     isPlaced = true;
     displayTextScript.SetEnabled(false);
 }