Closed TimmermanV closed 5 years ago
Wow, your project surely is capable of finding all the edge cases 😄 This one will be harder to debug though. Somehow, a cyclic graph is generated but the callStack inside AssetUsageDetector.SearchObject function is supposed to prevent it. I'm assuming that this issue didn't occur on previous versions and that it occurs when you click the "GO!" button in the AssetUsageDetector window.
Could you comment out these lines and see if it changes anything: https://github.com/yasirkula/UnityAssetUsageDetector/blob/96315ec435ff14cfd877d59db67bc7babbe75a1c/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs#L1226-L1267
If it doesn't work, please try commenting out these lines, as well: https://github.com/yasirkula/UnityAssetUsageDetector/blob/96315ec435ff14cfd877d59db67bc7babbe75a1c/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs#L966-L967
The issue seems to occur in v1.7 and v1.7.1. Earlier versions v1.5.1 and v1.5.6 didn't have the issue. The errors show up in the console at the end of the search when the results are presented. I have tried commenting out both 1226-1267 and 966-967 as you suggested. That doesn't seem to make a difference.
OK this version should get rid of the StackOverflowException. As a bonus, the rendering of search results are now handled via GUI instead of GUILayout which should increase the GUI performance significantly. Could you please test the new version when you have some spare time?
How do I use that archive? Extracting the files, it looked like it might be a unitypackage file, but I tried changing the extension to unitypackage and Unity just said "Nothing to import".
There is a unitypackage inside the zip. You should first unzip the file and then import the unitypackage to your project.
Ah, for some reason when extracting the zip, my zip program (on MacOS) decided to unpack the unitypackage as well. (I guess it tried to be helpful as unitypackage is also just a zip file) I used the command line unzip which worked fine.
The stack overflow is gone, but now I get this error:
IndexOutOfRangeException: Index was outside the bounds of the array.
AssetUsageDetectorNamespace.SearchResultGroup.GenerateGUINodes (AssetUsageDetectorNamespace.SearchResultDrawParameters parameters) (at Assets/Plugins/AssetUsageDetector/Editor/SearchResult.cs:765)
AssetUsageDetectorNamespace.SearchResultGroup.DrawOnGUI (AssetUsageDetectorNamespace.SearchResultDrawParameters parameters) (at Assets/Plugins/AssetUsageDetector/Editor/SearchResult.cs:645)
AssetUsageDetectorNamespace.SearchResult.DrawOnGUI (AssetUsageDetectorNamespace.SearchResultDrawParameters parameters) (at Assets/Plugins/AssetUsageDetector/Editor/SearchResult.cs:204)
AssetUsageDetectorNamespace.Extras.AssetUsageDetectorWindow.OnGUI () (at Assets/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs:540)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:335)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:329)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:305)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:373)
UnityEditor.DockArea.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:340)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:295)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:481)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent () (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:455)
UnityEngine.UIElements.UIR.ImmediateRenderer.Draw (UnityEngine.UIElements.UIR.DrawChainState dcs) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderers.cs:447)
UnityEngine.UIElements.UIR.UIRenderDevice.ContinueChain (UnityEngine.UIElements.UIR.RendererBase head, UnityEngine.UIElements.UIR.DrawChainState dcs, System.Boolean outerChainsWithMeshRenderer) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderDevice.cs:865)
UnityEngine.UIElements.UIR.UIRenderDevice.DrawChain (UnityEngine.UIElements.UIR.RendererBase head, UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.Texture atlas) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderDevice.cs:848)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect topRect, UnityEngine.Matrix4x4 projection) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:218)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:190)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTree () (at /Users/builduser/buildslave/unity/build/Modules/UIElements/VisualTreeUpdater.cs:70)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Panel.cs:589)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:240)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)```
Full drawing mode seems to be fine, but Shorter and Shortest produce these errors.
Yes, my mistake. Please change references.Count to guiNodes.Length at lines 764 and 772. Thanks again for your continuous support 😃
P.S. This is the latest version of the plugin; I've modified it a little bit more to get rid of some redundant references that showed up in the results.
That last version works great. And you're welcome. Thanks for the awesome software!
I just tested version 1.7.1 and got the following exception during search:
After this exception a few more issues popped up, but they are probably the result of the first issue: