Search Unity

Unity UI Are the public UI repository on bitbucket still updated?

Discussion in 'UGUI & TextMesh Pro' started by Coredumping, May 9, 2018.

  1. Coredumping

    Coredumping

    Joined:
    Dec 17, 2014
    Posts:
    51
    I'm running Unity 5.5.6 from Jan 2018, but the last update to the UI branch for 5.5 was in 2016. Will I end up adding back old bugs if I use the version of the UI from the repository?
     
  2. Coredumping

    Coredumping

    Joined:
    Dec 17, 2014
    Posts:
    51
    Since the bug I was trying to fix still seems exist in the Unity 2017 branches: The KeyPressed function for the InputField class should exit sooner if the composition string has any content, otherwise you get out of range exceptions, since the user might not have finished typing the character, but the caret acts like it has. Adding a "compositionString.Length > 0" check before the actual char is processed fixes this bug completely.
     
  3. Coredumping

    Coredumping

    Joined:
    Dec 17, 2014
    Posts:
    51
    So I compiled a list of fixes the UI system has undergone for Unity 5.5 since December 2016 and can confirm that the UI branch is not up to date. In case anyone stumbles on this, here are a list of things that are seemingly not fixed:
    • (856733) - UI: Fixed a curve preview cache not updating preview if curve data had changed but not the bounds.
    • (845756) - UI: Fixed a NullReferenceException when changing font to none.
    • (857087) - UI: Fixed miscoloured mesh when this was created with CanvasRenderer.SetMesh, passing an array of Color objects to Mesh.colors.
    • (873678) - UI: Fixed an occasional masking issue when using deferred rendering path on Linux.
    • (856380) - UI: Fixed scrollrect performance being slow when it had a lot of content.
    • (861736, 872634) - UI: Selection elements will update selection state when interactable is changed.
    • (858645) - UI : Fixed the issue of fonts created at runtime not showing up when added to text.
    • (898809) - UGUI: Fixed crash when reparenting inactive object.
    • (none) - UGUI: Fixed memory leak in UGUI.
    • (907581) - UI: Fixed a memory leak in UI::DepthSortLayer(). Fixed a crash when UI Element m_Scale value was set to a large number, in the Editor or via script.
    • (917177) - UI: Fixed a rare Transform::kReceivedDueToParentTRSChanged assertion failure introduced in 5.5.3p4.
    • (743134) - UI: Fixing an issue with Input Field caret not masking properly.
    • (905337, 958707) - UI: Fixed an issue whereby the CanvasManager cleared the stencil buffer every frame.
     
  4. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    I am not sure about the update state of the bitbucket repository.
    But maybe if you describe your problem a little bit better we could find a solution...

    I am not sure what bug you are trying to fix. I have used Input Fields also in Unity 5.5 and below but didn't have any issues.
    However, for text related stuff I do not use the UGUI components at all anymore. Text Mesh Pro is now for free and also offers an Input Field for UGUI. Maybe this works for you better?
    Text Mesh Pro simply looks much better. So, I think there is no reason why you would ever use the UGUI Text Component
     
  5. Coredumping

    Coredumping

    Joined:
    Dec 17, 2014
    Posts:
    51
    My problem is the IME implementation of the UI inputfield class is currently broken, due to a couple of lines of code in the KeyPressed function. This either has to be fixed on Unity's side or the repository has top be updated for us to fix it, since it raises exceptions in the UI event handling code that are impossible to catch.

    Migrating to text mesh pro is not feasible at this point for my project.

    Here's an example from a player session:
    Code (CSharp):
    1. ArgumentOutOfRangeException: Cannot be negative.
    2. Parameter name: length
    3. System.String.Substring (Int32 startIndex, Int32 length)
    4. UnityEngine.UI.InputField.Delete ()
    5. UnityEngine.UI.InputField.Insert (Char c)
    6. UnityEngine.UI.InputField.Append (Char input)
    7. UnityEngine.UI.InputField.KeyPressed (UnityEngine.Event evt)
    8. UnityEngine.UI.InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData)
    9. UnityEngine.EventSystems.ExecuteEvents.Execute (IUpdateSelectedHandler handler, UnityEngine.EventSystems.BaseEventData eventData)
    10. UnityEngine.EventSystems.ExecuteEvents.Execute[IUpdateSelectedHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor)
    11. UnityEngine.EventSystems.EventSystem:Update()
    These happen quite often. As you can see I can't easily catch that exception, and even if I could, the player would have unpredictable behavior using IME, which can't be disabled in Unity 5 for some reason.
     
    Last edited: May 10, 2018
  6. Dj_Payload

    Dj_Payload

    Joined:
    Mar 16, 2017
    Posts:
    5
    I just wanted to pitch in on this and second that this is an issue for us too, and has been for quite some time.
    We're using Unity version 2017.4.1f1 (LTS), and are getting regular crash reports sent in by players with the stack traces listed below.

    Moving our InputFields to TMP is not an option as we support Chinese character input among others. This requires dynamic font support which TMP doesn't currently have.

    Code (CSharp):
    1.  
    2. ArgumentOutOfRangeException: Cannot be negative.
    3. Parameter name: length
    4.   at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
    5.   at UnityEngine.UI.InputField.Delete () [0x00000] in <filename unknown>:0
    6.   at UnityEngine.UI.InputField.Insert (Char c) [0x00000] in <filename unknown>:0
    7.   at UnityEngine.UI.InputField.Append (Char input) [0x00000] in <filename unknown>:0
    8.   at UnityEngine.UI.InputField.KeyPressed (UnityEngine.Event evt) [0x00000] in <filename unknown>:0
    9.   at UnityEngine.UI.InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
    10.   at UnityEngine.EventSystems.ExecuteEvents.Execute (IUpdateSelectedHandler handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <filename unknown>:0
    11.   at UnityEngine.EventSystems.ExecuteEvents.Execute[IUpdateSelectedHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) [0x00000] in <filename unknown>:0
    12.  

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2.   at UnityEngine.UI.InputField.GenerateCaret (UnityEngine.UI.VertexHelper vbo, Vector2 roundingOffset) [0x00000] in <filename unknown>:0
    3.   at UnityEngine.UI.InputField.OnFillVBO (UnityEngine.Mesh vbo) [0x00000] in <filename unknown>:0
    4.   at UnityEngine.UI.InputField.UpdateGeometry () [0x00000] in <filename unknown>:0
    5.   at UnityEngine.UI.InputField.Rebuild (CanvasUpdate update) [0x00000] in <filename unknown>:0
    6.   at UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () [0x00000] in <filename unknown>:0
    7. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    8. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    9. UnityEngine.Logger:LogException(Exception, Object)
    10. UnityEngine.Debug:LogException(Exception, Object)
    11. UnityEngine.UI.CanvasUpdateRegistry:PerformUpdate()
    12. UnityEngine.Canvas:SendWillRenderCanvases()
    Is there any chance we might see these issues fixed on the LTS chain?