protected override void UpdateBounds() { LeaveBounds = new TrajectoryBound(new StraightTrajectory(Position, Position + NodeMarkupTool.CameraDirection * (Step * Points.Count)), PointSize + 3 * Space); foreach (var point in Points) { var pointPosition = Points.Count > 1 ? Position + NodeMarkupTool.CameraDirection * (Step * (PointsBounds.Count + 1)) : Position; var pointBounds = new Bounds(pointPosition, Vector3.one * PointSize); PointsBounds.Add(point, pointBounds); } }
protected override void UpdateBounds() { var r = Mathf.Max((Step / 2) / Mathf.Sin(180 / Points.Count * Mathf.Deg2Rad), Step); var dir = NodeMarkupTool.CameraDirection.Turn90(true); CircleLeaveBounds = new Bounds(Position, Vector3.one * (Points.Count > 1 ? (2 * r + PointSize + 3 * Space) : PointSize)); LineLeaveBounds = new TrajectoryBound(new StraightTrajectory(Position - dir * r, Position + dir * r), PointSize + 3 * Space); foreach (var point in Points) { var pointPosition = Points.Count > 1 ? Position + dir.TurnDeg(360 / Points.Count * PointsBounds.Count, true) * r : Position; var pointBounds = new Bounds(pointPosition, Vector3.one * PointSize); PointsBounds.Add(point, pointBounds); } }