Search Unity

Bug Disabled "Sprite Shape Controller" Bug + Quick "Sprite Shape Controller" feature request

Discussion in 'Editor & General Support' started by Odd_Eyes, Sep 7, 2022.

  1. Odd_Eyes

    Odd_Eyes

    Joined:
    Feb 26, 2019
    Posts:
    9
    Hi,

    There seem to be a bug with the Sprite Shape Controller where, if I disable the object having the Sprite Shape Controller component attached, or disable any of its parents, unity trhows an error (2 identical errors to be exact) per each disabled object which says
    "A Native Collection has not been disposed, resulting in a memory leak.".

    I used the "Full Stack Traces (Expensive)" option from the com.unitiy.entities Unity Package to get details about the error, and ensured the error wasn't caused by any of my scripts, but rather seems to be caused by just U2D library's Sprite Shape Controller functions.

    Unity Technologies staff might be already familiar with this, because the same error was labelled as "Fixed" with a previous update of the Sprite Shape Controller Unity Package, but for some reasons it came back again...

    Note, by the way, that this error popped up for the first time when the project was updated to use Unity 2021.3.9f1 from Unity 2020.3.38f1, and after updating the Sprite Shape Controller Unity Package to the last version while inside the 2021.3.9f1 Package Manager.

    Also, again, if anybody from Unity Technologies is reading this, and about the Sprite Shape Controller API, I have a question which translates to a feature request...
    Why does the "Spline.SetCorner(int index, bool value)" have the "valule" parameter typed "bool"? It sets the corner type of the spline with index "index" to either "Corner.Disabled" if "value == false", or to "Corner.Automatic" if "value == true", but there is a third option available, which is "Corner.Stretched", which can only be set from the Unity Editor itself, not with the API: it might be useful to be able to set each corner to "Corner.Stretched" from script too though (especially with custom editors/inspectors).
    By the way, "Corner.Stretched" is already defined too and it is already "possibe" to set the corner type to "Corner.Stretched" from script: I tried changing the "Spline.SetCorner(int index, bool value)" function defined in the actula "Spline" class of the Package to set the corner value to "Corner.Stretched" instead of "Corner.Disabled" when the "value" parameter is passed as false, and it worked just fine, but it is not possible to set the corner value from the "Sprite Shape Controller" API without modifiying the actual "Spline" class, so i reverted it back to normal.
    So, it would be helpful to be able to pass a 3-sized Spline.Corner enum value to the "Spline.SetCorner(int index, bool value)" function instead of just a binary bool.

    Thank you in advance :D