Topic: ArgumentOutOfRangeException: Length cannot be less than zero.

Hello, The tool is just great, it makes work extremely easy. But now I get the following message every second.

ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <695d1cc93cca45069c528c15c9fdd749>:0)
InfinityCode.uContext.Tools.HierarchyHeader.OnHierarchyItem (InfinityCode.uContext.HierarchyItem item) (at Assets/Plugins/Infinity Code/uContext/Scripts/Editor/Tools/HierarchyHeader.cs:121)
InfinityCode.uContext.HierarchyItemDrawer.OnHierarchyItemGUI (System.Int32 id, UnityEngine.Rect rect) (at Assets/Plugins/Infinity Code/uContext/Scripts/Editor/Managers/HierarchyItemDrawer.cs:53)
UnityEngine.Debug:LogException(Exception)
InfinityCode.uContext.Log:Add(Exception) (at Assets/Plugins/Infinity Code/uContext/Scripts/Editor/Core/Log.cs:13)
InfinityCode.uContext.HierarchyItemDrawer:OnHierarchyItemGUI(Int32, Rect) (at Assets/Plugins/Infinity Code/uContext/Scripts/Editor/Managers/HierarchyItemDrawer.cs:57)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

after about 5 minutes I'm already at over 400,000 messages.
unfortunately I don't know how to fix it.
Since at some point my system is slowed down by it, it happens now and then that my system then freezes for 1-2 seconds.
I am using Unity 2020.3.10f1

Re: ArgumentOutOfRangeException: Length cannot be less than zero.

Hello.

Thank you for the bug report.
The patch is attached.

Post's attachments

Attachment icon uContext v2.6 - Hierarchy Header Fix 2.unitypackage 1.49 kb, 98 downloads since 2021-07-06 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: ArgumentOutOfRangeException: Length cannot be less than zero.

Thank you that was quick. It worked out great.

4 (edited by anoainteractive 2021-08-02 11:39:56)

Re: ArgumentOutOfRangeException: Length cannot be less than zero.

Alex Vertax wrote:

Hello.

Thank you for the bug report.
The patch is attached.

Hello the path doesn't fix my problem. The error still appear when I tried to used the duplicate tools. And the duplicate and snapping  also didn't work

[Update]
The error only appears when snapping is turn off. Is it a bug?

Re: ArgumentOutOfRangeException: Length cannot be less than zero.

Hello.
This patch is for uContext v2.6.
The current version of uContext is 2.7.
Try updating the asset using the Asset Store or the built-in update system (if you are using PRO).
If the problem persists, please tell me more about this problem, and if you have any exceptions in the console, please send a stack trace.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.