Ejemplo n.º 1
0
        internal CollisionPair2D(Collider2D collider1, Collider2D collider2)
        {
            this.collider1 = collider1;
            this.collider2 = collider2;

            collisionPairState = new CollisionPairState();
        }
Ejemplo n.º 2
0
 internal void Collision(Collider2D other, CollisionPairState state, HitState hitState)
 {
     if (state.enter)
     {
         CollisionEnter?.Invoke(other, hitState);
     }
     if (state.stay)
     {
         CollisionStay?.Invoke(other, hitState);
     }
     if (state.exit)
     {
         CollisionExit?.Invoke(other, hitState);
     }
 }
Ejemplo n.º 3
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);
     }
 }