当先锋百科网

首页 1 2 3 4 5 6 7
RaycastHit2D hit2D 
	= Physics2D.Raycast(transform.position, transform.right, sightDis);

在这种情况下sightDis根本不起作用,太坑了,必须要有层级才行…

public LayerMask layer;

RaycastHit2D hit2D 
	= Physics2D.Raycast(transform.position, transform.right, sightDis, layer);