Hello Guest

Author Topic: NullReferenceException, sprite collection editor now working  (Read 4230 times)

kallekarkkainen

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
NullReferenceException, sprite collection editor now working
« on: March 22, 2013, 05:40:47 pm »
Hi,

I've got a problem with the sprite collection editor, as it will not show any content.

It spills these:
Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.DoTextField (System.String text, Int32 maxLength, Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
tk2dSpriteCollectionEditorPopup.DrawToolbar () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:378)
tk2dSpriteCollectionEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:826)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

followed by


ArgumentException: Getting control 2's position in a group with only 2 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext ()
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.DoTextField (System.String text, Int32 maxLength, Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options)
tk2dSpriteCollectionEditorPopup.DrawToolbar () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:378)
tk2dSpriteCollectionEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:826)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)




What can I do? I basically just created a sprite collection, and tried to open it's editor.

I'm on 4.1.0f4

kallekarkkainen

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: NullReferenceException, sprite collection editor now working
« Reply #1 on: March 22, 2013, 05:51:02 pm »
I researched it a bit further, added some debug lines along the skin part trying to find if there was something breaking in the skin. Then it started working (after restart). I don't even... *sigh*

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: NullReferenceException, sprite collection editor now working
« Reply #2 on: March 22, 2013, 06:00:12 pm »
I've had 4 reports of this. Not an alarming number, but still slightly worrying regardless.
In half of the cases it has been because of GUID corruption due to copying/sharing stuff without meta files.

How/when did this start happening?
Did you upgrade anything?

kallekarkkainen

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: NullReferenceException, sprite collection editor now working
« Reply #3 on: March 23, 2013, 01:36:47 pm »
How/when did this start happening?
Did you upgrade anything?

Well, if my memory serves it went exactly like this:
  • I downloaded the 4.0 unity
  • I bought the tk2d, and some other stuff (not related)
  • I started a project, worked on it for a few days
  • Updated to 4.1
  • Unity started working really strange (when starting the game, it would add red text to its controls and all that, game pausing would clear this), at this time I noted the exceptions for the first time.
  • After that, restarted unity a few times, kept seeing a lot of exceptions
  • Then considered updating tk2d, or canning the and starting fresh
  • debugged, and magically after restart, the problem was gone

I don't think this fills the requirements for being labeled a heisenbug, as there is my project that transitioned from 4.0 to 4.1.

If you happen to figure it out, I'd really like to know.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: NullReferenceException, sprite collection editor now working
« Reply #4 on: March 23, 2013, 07:03:47 pm »
I'll look into this. Thanks for the comprehensive report :)
What platform are you running on?