Hello Guest

Author Topic: NullReferenceException when using 2DToolkit - requires restart of Unity  (Read 5258 times)

masterhyjinx

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
I just bought 2DToolkit and I'm suffering a myriad of technical issues.  It seems that after a few minutes of using it I get a NullReferenceException and then none of the editors work until I restart Unity.  This usually seems to happen if the Editor windows are open when I start Unity but I'm not sure that's relevant.  After I get the first error, I cannot interact with the editor windows at all (Move, resize or close) and I must restart Unity and continue until it happens again.  The errors seem to start popping up when I start up Unity and then select a sprite in my scene.

I'm on OS X Mountain Lion, 27inch Imac (2012) using Unity 4.1.3

The first error:

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)


Second Error:

ArgumentException: Getting control 2's position in a group with only 2 controls when doing ValidateCommand
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)


Then they continue to repeat.  Has anyone experienced this?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
No I can't say I've seen this.
What version of 2D Toolkit are you using? Check the 2D Toolkit > About menu option to find out.

To troubleshoot further -
1. Create a brand new project, import 2D Toolkit into it. (Make sure you're on 1.92 final + patch1)
2. Try to recreate the issue using the assets distributed with it.
3. If you can't, then import your assets and try to reproduce it.

Worst case, zip up your project and email it to support at unikronsoftware dot com and I'll investigate further.
You shouldn't get those errors.


masterhyjinx

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
The about says that I'm using 1.92 and patch 1:

2D Toolkit Version 1.92 final + patch 1

Let me try to recreate the issue in a vanilla project.  It's very late for me so I may get back to you tomorrow.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Sure. You're on the right version - there aren't any known issues like this in 4.1.3 so it'd be good to get to the bottom of it.