RaycastHit2D hit2D = Physics2D.Raycast(transform.position, transform.right, sightDis);
在这种情况下sightDis根本不起作用,太坑了,必须要有层级才行…
public LayerMask layer; RaycastHit2D hit2D = Physics2D.Raycast(transform.position, transform.right, sightDis, layer);