private void OnTriggerExit(Collider other)
 {
     otherBehaviourObj = other.GetComponent <IDBehavior>();
     if (otherBehaviourObj == null)
     {
         return;
     }
     otherIdObj = otherBehaviourObj.nameIdObj;
     CheckId(3);
 }
 public void OnTriggerEnter(Collider other)
 {
     otherBehaviourObj = other.GetComponent <IDBehavior>();
     if (otherBehaviourObj == null)
     {
         return;
     }
     otherIdObj = otherBehaviourObj.nameIdObj;
     CheckId(1);
 }
    private IEnumerator OnTriggerExit(Collider other)
    {
        otherBehaviourObj = other.GetComponent <IDBehavior>();
        if (otherBehaviourObj == null)
        {
            yield break;
        }
        otherIdObj = otherBehaviourObj.nameIdObj;
        yield return(waitExitObj);

        CheckId(3);
    }
Beispiel #4
0
    private void OnTriggerEnter(Collider other)
    {
        otherIDBehavior = other.GetComponent <IDBehavior>();
        if (otherIDBehavior == null)
        {
            return;                          //If the object doesn't have an ID then stop
        }
        otherID = otherIDBehavior.IDObj;
        CheckID();

        if (playerInRange)
        {
            playerInRangeEvent.Invoke();
        }
    }