Author Topic: AtlasMaker Array index is out of range.  (Read 5624 times)

gorksmash

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
AtlasMaker Array index is out of range.
« on: October 16, 2013, 08:36:03 AM »
When I try to add a sprite to the SciFi atlas I get this error message:

IndexOutOfRangeException: Array index is out of range.
UIAtlasMaker.ExtractSprites (.UIAtlas atlas, System.Collections.Generic.List`1 finalSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:423)
UIAtlasMaker.UpdateAtlas (System.Collections.Generic.List`1 textures, Boolean keepSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:548)
UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:878)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/c514da0c8183631c/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

This happens with the SciFi atlas only

any help is appreciated

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: AtlasMaker Array index is out of range.
« Reply #1 on: October 16, 2013, 01:08:41 PM »
Well, first of all, the SciFi atlas was not created using the atlas maker. It was created long before the atlas maker was added.

Second, it would help to know what version of NGUI you're using, as well as what other plugins you have installed.

wom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: AtlasMaker Array index is out of range.
« Reply #2 on: November 09, 2013, 11:08:33 PM »
Yeah - this happens to me on NGUI 3.0.5 with Unity 4.2.2f1.

Reproduction steps:
New project, import NGUI, then try to delete a sprite from the scifi atlas and get an index out of range exception.
Tried the same thing with the fantasy atlas and was able to delete a sprite just fine - so as you say, it's just the scifi atlas itself, not NGUI.

Not gonna lie - I've totally been ripping off the NGUI example assets in my current project  ;D
(It's not on the store or anything, I'm just learning at the moment.)
I wanted to add a pause button sprite to the scifi atlas and started getting this error.  Good to know it's just the the atlas itself - I thought I was doing something wrong or seeing a problem with NGUI.

Speaking of which - are we allowed to use the NGUI example assets in commercial work?


NGUI 3.0.5 stack trace:
  1. IndexOutOfRangeException: Array index is out of range.
  2. UIAtlasMaker.ExtractSprites (.UIAtlas atlas, System.Collections.Generic.List`1 finalSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:423)
  3. UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:867)
  4. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/c514da0c8183631c/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: AtlasMaker Array index is out of range.
« Reply #3 on: November 10, 2013, 06:55:38 AM »
Yup, you are welcome to use the NGUI example atlases as you see fit. I would suggest extracting the sprite from the atlas though (using Photoshop or any other image editing plugin). The way SciFi atlas was packed (by hand) is just... different.

HashbangGames

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: AtlasMaker Array index is out of range.
« Reply #4 on: November 22, 2013, 11:13:50 AM »
Bump.

This is happening to me in my current project.  It's my own atlas that I've made with the NGUI Atlas maker.
Using NGUI 3.0.5,  Unity 4.2.2...yada yada.

I'm getting this same exact error.   Index out of array,   NGUIAtlasMaker.cs   line 423.    Looks like when it's trying to redefined the sprite pixel position, something is going wrong.

let me know what you need from my end,  because my atlas is fairly large, and I do not want to have to rebuild the atlas because of this issue.

Thanks,
Marco

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: AtlasMaker Array index is out of range.
« Reply #5 on: November 22, 2013, 03:56:34 PM »
Yup, fixed in 3.0.6 :)