コード例 #1
0
 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);
     }
 }
コード例 #3
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();
         this.gameObject.active = false;
     }
 }
コード例 #4
0
 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();
     }
 }
コード例 #5
0
    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);
        }
    }
コード例 #6
0
    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);
        }
    }