private void DrawActualFieldOfView(FieldOfView fov) { var halfAngle = fov.ViewAngle / 2; var viewLeftBound = fov.GetDirectionFromAngle(-halfAngle, isGlobalAngle: false); var viewRightBound = fov.GetDirectionFromAngle(halfAngle, isGlobalAngle: false); Handles.color = Color.white; var playerPos = fov.transform.position; Handles.DrawLine(playerPos, playerPos + viewLeftBound * fov.ViewRadius); Handles.DrawLine(playerPos, playerPos + viewRightBound * fov.ViewRadius); }
public FieldOfViewVisual(FieldOfView fov) { this.fov = fov; }
private void DrawPossibleFieldOfView(FieldOfView fov) { Handles.color = Color.red; Handles.DrawWireArc(fov.transform.position, Vector3.up, fov.transform.forward, 360, fov.ViewRadius); }