예제 #1
0
 void OnTriggerEnter(Collider other)
 {
     if (CollisionLayers == (CollisionLayers | (1 << other.gameObject.layer)))
     {
         onTrigger?.Invoke(other);
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag != "Player")
     {
         TriggerEnter?.Invoke(this, other.gameObject);
     }
 }
예제 #3
0
 private void OnTriggerEnter(Collider otherCollider)
 {
     if (TriggerEnter != null)
     {
         TriggerEnter.Invoke(otherCollider);
     }
 }
 public void OnTriggerEnter(Collider other)
 {
     if (CheckLayer(other))
     {
         TriggerEnter?.Invoke(other);
     }
 }
예제 #5
0
 private void OnTriggerEnter(Collider other)
 {
     if (!triggerEntered)
     {
         triggerEntered = true;
         TriggerEnter?.Invoke(other);
     }
 }
예제 #6
0
        private void OnTriggerEnter(Collider other)
        {
            var entity = other.GetComponentInParent <IGameEntity>();

            if (entity != null && TriggerEnter != null)
            {
                TriggerEnter?.Invoke(entity);
            }
        }
예제 #7
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            return;
        }

        TriggerEnter?.Invoke();
    }
예제 #8
0
        protected virtual void OnTriggerEnter(EventArgs e)
        {
            Log("Entered trigger: " + _name);
            if (debugLevel > 1)
            {
                ShowMessage("Entered trigger: " + ToString());
            }

            TriggerEnter?.Invoke(this, index, e);
        }
예제 #9
0
        internal void OnTriggerEnter(Collider collider)
        {
            TriggerEnter?.Invoke(collider);

            var rigidbody = AttachedRigidBody;

            if (rigidbody)
            {
                rigidbody.OnTriggerEnter(collider);
            }
        }
예제 #10
0
 internal void Trigger(Collider2D other, CollisionPairState state)
 {
     if (state.enter)
     {
         TriggerEnter?.Invoke(other);
     }
     if (state.stay)
     {
         TriggerStay?.Invoke(other);
     }
     if (state.exit)
     {
         TriggerExit?.Invoke(other);
     }
 }
예제 #11
0
    private void OnTriggerEnter(Collider other)
    {
        if (hitLayers != (hitLayers | (1 << other.gameObject.layer)))
        {
            return;
        }

        if (onlyTriggerOnce && hasTriggered)
        {
            return;
        }

        hasTriggered = true;

        if (onTriggerEnterEvent != null)
        {
            onTriggerEnterEvent.Invoke(other);
        }

        if (disableAfter)
        {
            gameObject.SetActive(false);
        }
    }
예제 #12
0
 private void OnTriggerEnter(Collider collider)
 {
     TriggerEnter?.Invoke(gameObject, collider);
 }
예제 #13
0
 internal void OnTriggerEnter(Collider collider)
 {
     TriggerEnter?.Invoke(collider);
 }
예제 #14
0
 private void OnTriggerEnter(Collider other)
 {
     TriggerEnter.Invoke();
 }
예제 #15
0
 private void OnTriggerEnter(Collider other) =>
 TriggerEnter?.Invoke(other);
 private void OnTriggerEnter2D(Collider2D collision)
 {
     TriggerEnter?.Invoke(_collider2D, collision);
 }
예제 #17
0
 private void OnTriggerEnter(Collider col)
 {
     TriggerEnter?.Invoke(col.gameObject);
 }
예제 #18
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     TriggerEnter?.Invoke(this, other.gameObject);
 }
예제 #19
0
 void OnTriggerEnter(Collider collider) =>
 TriggerEnter?.Invoke(collider);
 private void OnTriggerEnter(Collider other)
 {
     TriggerEnter?.Invoke(this, new TriggerEventArgs(other));
 }
예제 #21
0
        //private void OnCollisionEnter(Collision collision)
        //{
        //    TriggerEnter?.Invoke(collision.collider);
        //}

        //private void OnCollisionStay(Collision collision)
        //{
        //    TriggerStay?.Invoke(collision.collider);
        //}

        //private void OnCollisionExit(Collision collision)
        //{
        //    TriggerExit?.Invoke(collision.collider);
        //}

        public void RaiseTriggerEnter(Collider other)
        {
            TriggerEnter?.Invoke(other);
        }
 private void OnTriggerEnter(Collider other)
 {
     TriggerEnter?.Invoke(other.gameObject);
 }