protected override void OnSceneGUI() { base.OnSceneGUI(); SplineFollower user = (SplineFollower)target; if (Application.isPlaying) { if (!user.autoFollow) { DrawResult(user.offsettedResult); } return; } if (user.computer == null) { return; } if (user.autoStartPosition) { user.Evaluate(result, user.address.Project(user.transform.position, 4, user.clipFrom, user.clipTo)); DrawResult(result); } else if (!user.autoFollow) { DrawResult(user.result); } }
public SplineResult GetFollowResult(SplineFollower follower, double percent) { SplineResult result = follower.Evaluate(percent); Vector3 right = Vector3.Cross(result.direction, result.normal); result.position += -right * follower.offset.x * result.size + result.normal * follower.offset.y * result.size; return(result); }