Esempio n. 1
0
    private void OnTriggerStay(Collider other)
    {
        if (Input.GetKeyDown("e"))
        {
            //Debug.Log("Interacted with: " + other.name);

            // Toggle if an object has been in use or not.
            ObjectInteraction interactObject = other.gameObject.GetComponent <ObjectInteraction>();
            interactObject.isUsed = !interactObject.isUsed;
            interactObject.Interaction();
        }
    }
    void Update()
    {
        if (InfoUp)
        {
            if (TimePassed >= DespawnTimer)
            {
                InfoUp        = false;
                infoText.text = null;
                TimePassed    = 0f;
            }
            else
            {
                TimePassed = TimePassed + Time.deltaTime;
            }
        }

        if (Input.GetKey(KeyCode.Space))
        {
            if (Won != true)
            {
                if (InteractObject != null)
                {
                    InteractScript.Interaction();
                }
            }
            else
            {
                SceneManager.LoadScene(0);
            }
        }

        if (CurrentQuestStage >= QuestAmount)
        {
            Debug.Log("INSERT VICTORY TEXT HERE");
        }
    }
Esempio n. 3
0
 private void setInteractStatus(ObjectInteraction obj, bool status)
 {
     obj.isUsed = status;
     obj.Interaction();
 }