Skip to content

Common.Physic

DucNV_2000 edited this page Jul 10, 2024 · 1 revision

Common.Physic

  • IgnoreCollision
// Ignore Collision between a Collider and a list of Collider
 void IgnoreCollision(List<Collider> _listCollider, Collider _collider)
// Ignore Collision between a Collider and a list of Collider
 void IgnoreCollision(Collider _collider, List<Collider> _listCollider)
// Ignore Collision between a list of Collider and a list of Collider
 void IgnoreCollision(List<Collider> _listCollider1, List<Collider> _listCollider2)

Example IgnoreCollision:

    public Collider collider;
    public List<Collider> listCollider;
    public List<Collider> listCollider2;

    public void IgnoreCollision()
    {
        Common.IgnoreCollision(collider, listCollider);
        // Or
        Common.IgnoreCollision(listCollider, collider);
    }

    public void IgnoreCollisionListColliderWithListCollider()
    {
        Common.IgnoreCollision(listCollider, listCollider2);
    }
  • IgnoreCollision2D
// Ignore Collision 2D between a Collider and a list of Collider
 void IgnoreCollision2D(List<Collider2D> _listCollider, Collider2D _collider)
// Ignore Collision 2D between a Collider and a list of Collider
 void IgnoreCollision2D(Collider2D _collider, List<Collider2D> _listCollider)
// Ignore Collision 2D between a list of Collider and a list of Collider
 void IgnoreCollision2D(List<Collider2D> _listCollider1, List<Collider2D> _listCollider2)

Example IgnoreCollision2D

    public Collider2D collider;
    public List<Collider2D> listCollider;
    public List<Collider2D> listCollider2;

    public void IgnoreCollision2D()
    {
        Common.IgnoreCollision2D(collider, listCollider);
        // Or
        Common.IgnoreCollision2D(listCollider, collider);
    }

    public void IgnoreCollision2DListColliderWithListCollider()
    {
        Common.IgnoreCollision2D(listCollider, listCollider2);
    }
Clone this wiki locally