private void LateUpdate() { if (Bezier == null) { return; } transform.position = Bezier.transform.TransformPoint(BezierHelper.BezierValue(CurrentStepLength, Points)); float value = pathTool.FiringGap < 1 ? StepLengthFactor / StepLength : StepLengthFactor / StepLength + pathTool.CompensationFactor; CurrentStepLength += value; }
// Update is called once per frame void Update() { if (CurrentStepLength > MaxStepLength) { pathTool.PointList.Add(gameObject); gameObject.SetActive(false); return; } Bezier = GetComponentInParent <BezierCurve>(); Target = Bezier.transform.TransformPoint(BezierHelper.BezierValue(CurrentStepLength, Points)); AutoRotate(Target); }
public Vector3 GetPoint(float t) { return(transform.TransformPoint(BezierHelper.BezierValue(t, Points))); }