Author Topic: UIDrawCall  (Read 7878 times)

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
UIDrawCall
« on: May 17, 2013, 09:15:35 PM »
I'm having some issue since I updated to the last NGUI version, something with the UIDrawCalls.
In the HUD I have 2 buttons there's always showing and when I try to disable them it, it doesn't dissapear, even if I disable the original object.
I selected them in the scene and in the Inspector shows _UIDrawCall [HUD].


This is creating me a long list of bugs.
How can I remove/clean this UIDrawCall?


Thanks in advance!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDrawCall
« Reply #1 on: May 18, 2013, 03:17:06 AM »
When you set panel debug info to "geometry", it will show hidden objects that it creates -- the draw calls. Without them you wouldn't see the UI. Switch debugging back to gizmos.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: UIDrawCall
« Reply #2 on: May 18, 2013, 02:33:31 PM »
Yeah, I notice this is not happening in the devices, just in the editor.


Thanks!

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: UIDrawCall
« Reply #3 on: September 12, 2013, 09:55:53 AM »
Sorry for another bump, but I continue seeing this issue and I have the UIPanel/Debug Info set to "Gizmos".

I just added a new sprite to the scene and now it's always showing, it's really annoying. This just occurs in the editor.

EDIT 1:
Even if I create a new scene the image continue displaying in the new one.
Added Inspector from new scene with the elements.

EDIT 2:
A friend removed it! Selecting the items and clicking on GameObject/Selection/Force Delete. I don't know if it's the best way, but at least it works.
« Last Edit: September 12, 2013, 10:09:05 AM by jeldrez »

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: UIDrawCall
« Reply #4 on: November 19, 2013, 10:37:17 AM »
This issue is still present in v3.0.5 and all my workmates are really annoyed with it.

And now the UIPanels doesn't have any Debug option.

Any real fix to this?

Thanks in advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDrawCall
« Reply #5 on: November 19, 2013, 09:05:41 PM »
I would really like to know how you are getting to the state where you have orphaned draw calls hanging around. If you can let me know the steps, I would really appreciate it and would certainly fix it.

Also, if you want to be able to see the hidden draw call objects, navigate to the following section in UIPanel:
  1. #if UNITY_EDITOR
  2.                 // If we're in the editor, create the game object with hide flags set right away
  3.                 GameObject go = UnityEditor.EditorUtility.CreateGameObjectWithHideFlags("_UIDrawCall [" + mat.name + "]",
  4.                         //HideFlags.DontSave | HideFlags.NotEditable);
  5.                         HideFlags.HideAndDontSave);
  6. #else
  7.                 GameObject go = new GameObject("_UIDrawCall [" + mat.name + "]");
  8.                 DontDestroyOnLoad(go);
  9. #endif
Uncomment the line that's commented out, and comment out the line that follows, like so:
  1. #if UNITY_EDITOR
  2.                 // If we're in the editor, create the game object with hide flags set right away
  3.                 GameObject go = UnityEditor.EditorUtility.CreateGameObjectWithHideFlags("_UIDrawCall [" + mat.name + "]",
  4.                         HideFlags.DontSave | HideFlags.NotEditable);
  5.                         //HideFlags.HideAndDontSave);
  6. #else
  7.                 GameObject go = new GameObject("_UIDrawCall [" + mat.name + "]");
  8.                 DontDestroyOnLoad(go);
  9. #endif

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: UIDrawCall
« Reply #6 on: November 19, 2013, 10:41:13 PM »
Ok, tomorrow morning I will try this and try to figure out the STR.

Thanks Aren.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDrawCall
« Reply #7 on: November 20, 2013, 03:52:46 AM »
I've added extra code to 3.0.6 to ensure that orphaned draw calls get destroyed. I had to physically break NGUI by having null exceptions get thrown during the draw call building process in order to get draw calls to stick around, but... it let me test things at least.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: UIDrawCall
« Reply #8 on: November 21, 2013, 01:37:11 PM »
I updated to v.3.0.6 to try to fix it and I got this error:

  1. Assets/NGUI/Scripts/Editor/ComponentSelector.cs(97,48): error CS1501: No overload for method `FindObjectsOfTypeAll' takes `0' arguments

What is wrong?

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDrawCall
« Reply #9 on: November 21, 2013, 01:39:46 PM »
What version of Unity?

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: UIDrawCall
« Reply #10 on: November 21, 2013, 01:47:11 PM »
Unity 4.2.2f1

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDrawCall
« Reply #11 on: November 21, 2013, 01:48:47 PM »
Perhaps the templated version was added in 4.3 then as that's what I'm using. Well, in any case I've just changed that line to use typeof instead, just grab the latest.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: UIDrawCall
« Reply #12 on: November 21, 2013, 03:04:05 PM »
I would really like to know how you are getting to the state where you have orphaned draw calls hanging around. If you can let me know the steps, I would really appreciate it and would certainly fix it.

Also, if you want to be able to see the hidden draw call objects, navigate to the following section in UIPanel:
  1. #if UNITY_EDITOR
  2.                 // If we're in the editor, create the game object with hide flags set right away
  3.                 GameObject go = UnityEditor.EditorUtility.CreateGameObjectWithHideFlags("_UIDrawCall [" + mat.name + "]",
  4.                         //HideFlags.DontSave | HideFlags.NotEditable);
  5.                         HideFlags.HideAndDontSave);
  6. #else
  7.                 GameObject go = new GameObject("_UIDrawCall [" + mat.name + "]");
  8.                 DontDestroyOnLoad(go);
  9. #endif
Uncomment the line that's commented out, and comment out the line that follows, like so:
  1. #if UNITY_EDITOR
  2.                 // If we're in the editor, create the game object with hide flags set right away
  3.                 GameObject go = UnityEditor.EditorUtility.CreateGameObjectWithHideFlags("_UIDrawCall [" + mat.name + "]",
  4.                         HideFlags.DontSave | HideFlags.NotEditable);
  5.                         //HideFlags.HideAndDontSave);
  6. #else
  7.                 GameObject go = new GameObject("_UIDrawCall [" + mat.name + "]");
  8.                 DontDestroyOnLoad(go);
  9. #endif

This didn't work, continues happening.  :-\

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIDrawCall
« Reply #13 on: November 22, 2013, 03:09:23 AM »
Continues happening even with the typeof parameter?

http://docs.unity3d.com/Documentation/ScriptReference/Resources.FindObjectsOfTypeAll.html

That has existed since Unity 3.X. Do you have your own Resources class, perhaps?