Exemplo n.º 1
0
    void AddSegment()
    {
        Vector3 newSegmentStartingPosition = path.GetLastAnchorPoint;

        Undo.RecordObject(creator, "Add segment");
        path.AddSegment(newSegmentStartingPosition);
    }
Exemplo n.º 2
0
    public void CreatePath()
    {
        path = new BezierPath(transform.position);

        // int length = Random.Range(5, 10);

        path.MovePoint(0, new Vector3(5, 0, -5));
        path.MovePoint(3, new Vector3(8, 0, 0));

        for (int i = 0; i < 6; i++)
        {
            path.AddSegment(GetPosition(i));
        }

        path.IsClosed             = true;
        path.AutoSetControlPoints = true;
    }