Example #1
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         myInteract      = true;
         i               = -1;
         m_Dialogue.text = "";
         myPlayer        = col.GetComponent <Player_Movement_Script>();
     }
 }
Example #2
0
 void OnTriggerExit2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         myInteract = false;
         if (myPlayer == col.GetComponent <Player_Movement_Script>())
         {
             myPlayer = null;
         }
     }
 }