Skip to content

Cannot clear SplineContainer.Splines  #3

Description

@aholkner

The following code does not work as expected

var splineContainer = GetComponent<SplineContainer>(); // Assume this container already has some splines
splineContainer.Splines = null; // Should clear all existing splines
splineContainer.AddSpline(new Spline()); // Expect to have one spline now

The reason is that SplineContainer.set_Splines sets m_Splines to Array.Empty, but does not clear m_ReadOnlySplines, which SplineUtility.AddSpline depends on.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions