Example #1
0
    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;
    }
Example #2
0
    // 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);
    }
Example #3
0
 public Vector3 GetPoint(float t)
 {
     return(transform.TransformPoint(BezierHelper.BezierValue(t, Points)));
 }