protected void OnTriggerExit2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         counter = 0;
         enter   = false;
         CloseTalk();
         DialoguePanel.hideOptions();
     }
 }
Пример #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         DialoguePanel.hideOptions();
         Cursor.visible = false;
         this.gameObject.GetComponent <DialogueWithTrigger>().enter   = true;
         this.gameObject.GetComponent <DialogueWithTrigger>().counter = 0;
         this.gameObject.GetComponent <DialogueWithTrigger>().NextMessage();
         cop.GetComponent <StateMachine>().changeState(cop.GetComponent <StateMachine>().ArrestState);
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         DialoguePanel.hideOptions();
         Cursor.visible = false;
         this.gameObject.GetComponent <DialogueWithTrigger>().enter   = true;
         this.gameObject.GetComponent <DialogueWithTrigger>().counter = 0;
         this.gameObject.GetComponent <DialogueWithTrigger>().NextMessage();
         this.gameObject.active = false;
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Crate")
     {
         collision.GetComponent <BoxCollider2D>().enabled = false;
         DialoguePanel.hideOptions();
         Cursor.visible = false;
         this.GetComponent <DialogueEngine>().ChangeDialogueToID(id, true);
         this.gameObject.GetComponent <DialogueWithTrigger>().enter   = true;
         this.gameObject.GetComponent <DialogueWithTrigger>().counter = 0;
         this.gameObject.GetComponent <DialogueWithTrigger>().NextMessage();
     }
 }
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.E) && enter && !talking)
        {
            DialoguePanel.hideOptions();
            NextMessage();
            Interacted = true;
        }

        if (GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>().enabled == false)
        {
            talking = true;
            Invoke("EnableTalking", 0.1f);
        }
    }
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.E) && enter && !talking && Time.timeScale != 0.0f)
        {
            DialoguePanel.hideOptions();
            NextMessage();
            Interacted = true;
        }

        if (Time.timeScale == 0)
        {
            talking = true;
            Invoke("EnableTalking", 0.1f);
        }
    }
Пример #7
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.E) && enter && !talking && Time.timeScale != 0.0f)
        {
            GameObject.FindGameObjectWithTag("Sound").GetComponent <SoundScript>().normalClick();
            DialoguePanel.hideOptions();
            NextMessage();
            Interacted = true;
        }

        if (Time.timeScale == 0)
        {
            talking = true;
            Invoke("EnableTalking", 0.1f);
        }
    }