Hello Guest

Author Topic: NullReference error when bringing up sprite collection  (Read 3104 times)

kathode

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
NullReference error when bringing up sprite collection
« on: October 04, 2015, 07:34:52 pm »
Hi,

I've had TK2D in my project for tilemaps for a long time now and everything's been fine. Today I tried my project on an iPhone 6s and saw black lines between tiles. I want to go in and mess around with the sprite collection padding settings but I'm running into this error when I try to bring it up:

Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
tk2dEditor.SpriteCollectionEditor.SpriteCollectionProxy.CopyFromSource (Boolean copyBuilt) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorProxy.cs:41)
tk2dEditor.SpriteCollectionEditor.SpriteCollectionProxy..ctor (.tk2dSpriteCollection obj) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorProxy.cs:17)
tk2dSpriteCollectionEditorPopup.SetGenerator (.tk2dSpriteCollection spriteCollection) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:234)
tk2dSpriteCollectionEditorPopup.SetGeneratorAndSelectedSprite (.tk2dSpriteCollection spriteCollection, Int32 selectedSprite) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:241)
tk2dTileMapEditor.DrawSettingsPanel () (at Assets/TK2DROOT/tk2dTileMap/Editor/tk2dTileMapEditor.cs:509)
tk2dTileMapEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2dTileMap/Editor/tk2dTileMapEditor.cs:1221)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1094)
UnityEditor.DockArea:OnGUI()

The sprite collection window pops up but it's blank. Oddly, the tutorial ones seem to work fine, so it's clearly something I messed up. But I'm not sure where to look. The tilemaps work fine in my game and it looks like the sprite collection objects are there. At least the selections in the 'sprite collection' dropdown on my tilemap objects look right. I updated to 2.5.4 but no change. Any help would be appreciated. Thank you!

kathode

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: NullReference error when bringing up sprite collection
« Reply #1 on: October 04, 2015, 07:47:46 pm »
Update: As often happens with me, posting publicly seems to have given me sufficient motivation to immediately find the answer myself. It appears I've solved this by finding deleted files in an old backup. I used a "build cleaner" tool at some point to wipe away unreferenced files and I guess some sprite collections got swept out. I'll have to be more careful in the future.