public static EdgeRaycaster Create(Vector2 edge, LayerMask layerMask) { EdgeRaycaster instance = CreateInstance <EdgeRaycaster>(); instance.layerMask = layerMask; instance.GenerateRayDeltas(edge); return(instance); }
public static BoxRaycaster Create(BoxCollider2D collider, LayerMask layerMask) { BoxRaycaster instance = CreateInstance <BoxRaycaster>(); instance.collider = collider; Bounds bounds = collider.bounds; instance.xEdge = EdgeRaycaster.Create(Vector2.right * bounds.size.x, layerMask); instance.yEdge = EdgeRaycaster.Create(Vector2.up * bounds.size.y, layerMask); return(instance); }