• Examples
  • [Runtime] Move control points (very simple)

using UnityEngine;

using CurveArchitect.Objects;

public class MoveArchitectCurve : MonoBehaviour
{
    [Header("Settings")]
    public ArchitectCurve architectCurve;
    public int segement;
    public float speed;

    void Update()
    {
        Vector3 translation = new Vector3(speed * Time.deltaTime, 0, 0);

        architectCurve.segements[segement].Translate(Segment.Type.ANCHOR, translation);
        architectCurve.segements[segement].Translate(Segment.Type.TANGENT_A, translation);
        architectCurve.segements[segement].Translate(Segment.Type.TANGENT_B, translation);

        //Whenever you change the position of any control point, you need to mark the monitor for the Architect Curve dirty.
        architectCurve.monitor.MarkDirty();
    }
}
    6 months later
    MikeDanielsson changed the title to [Runtime] Move control points (very simple) .