//private void OnCollisionStay2D(Collision2D collision)
 //{
 //    if (collision.gameObject.tag == gameObject.tag)
 //    {
 //        TriggerCheck = collision.gameObject.GetComponent<triggerCheck>();
 //        isSame = true;
 //    }
 //}
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.gameObject.tag == gameObject.tag)
     {
         TriggerCheck = collision.gameObject.GetComponent <triggerCheck>();
         isSame       = true;
     }
 }
Beispiel #2
0
 //private void OnTriggerStay2D(Collision2D collision)
 //{
 //        Debug.Log("rightSame");
 //    if (collision.gameObject.tag == gameObject.tag)
 //    {
 //        TriggerCheck = collision.gameObject.GetComponent<triggerCheck>();
 //        isSame = true;
 //    }
 //}
 private void OnTriggerEnter2D(Collider2D collision)
 {
     Debug.Log("rightTouched");
     if (collision.gameObject.tag == gameObject.tag)
     {
         TriggerCheck = collision.gameObject.GetComponent <triggerCheck>();
         isSame       = true;
     }
 }
Beispiel #3
0
 //private void OnCollisionStay2D(Collision2D collision)
 //{
 //    if (collision.gameObject.tag == gameObject.tag)
 //    {
 //        TriggerCheck = collision.gameObject.GetComponent<triggerCheck>();
 //        isSame = true;
 //    }
 //}
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.gameObject.tag == tag)
     {
         Debug.Log("downTouched");
         TriggerCheck = collision.gameObject.GetComponent <triggerCheck>();
         isSame       = true;
     }
 }
Beispiel #4
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Items")
     {
         triggerCheck trigger = gameObject.GetComponent <triggerCheck>();
         trigger.Triggered = true;
         Interactable interactable = other.GetComponent <Interactable>();
         if (interactable != null)
         {
             SetFocus(interactable);
         }
     }
 }
Beispiel #5
0
    private void OnTriggerExit(Collider other)
    {
        triggerCheck trigger = gameObject.GetComponent <triggerCheck>();

        trigger.Triggered = false;
    }