[bug]UISlider IndexOutOfRangeException

[bug]UISlider IndexOutOfRangeException

Postby RussellW » Fri Oct 10, 2014 4:02 pm

Hey Brady, I am updating an older project to the latest EZGUI 1.949 and I am getting an error with the UISlider index out of range. This slider worked fine under the older version of EZGUI. Specifically, the error is with line 349 in UISlider.cs
Code: Select all
knob.animations[3].SetAnim(states[5], 3);

This maybe a red herring (as I can't determine if it is the "animations" array or the "states" array that is out of range) but I have noticed that the "states" array correspond to:
Code: Select all
   public TextureAnim[] states = new TextureAnim[]
      {
         new TextureAnim("Filled bar"),
         new TextureAnim("Empty bar"),
         new TextureAnim("Knob, Normal"),
         new TextureAnim("Knob, Over"),
         new TextureAnim("Knob, Active"),
         new TextureAnim("Knob, Disabled")
      };


I did a diff with the old EZGUI and noticed this "knob, disabled" state is new. However, if you look at the Control Editor window when selecting the slider, it doesn't have "disabled" state (the entry corresponding to states[5] above). See attached screen shot. Possibly the editor is resetting "states" to just have 5 instead of 6 entries. Can you look into this?
Attachments
Screen Shot Missing disabled state.png
Screen shot of Control Editor missing the disabled state
RussellW
 
Posts: 4
Joined: Thu Jun 05, 2014 4:32 pm

Re: [bug]UISlider IndexOutOfRangeException

Postby RussellW » Fri Oct 10, 2014 4:12 pm

If it comment out line 349 in UISlider.cs, it appears to be working fine.
RussellW
 
Posts: 4
Joined: Thu Jun 05, 2014 4:32 pm

Re: [bug]UISlider IndexOutOfRangeException

Postby Brady » Fri Oct 10, 2014 4:22 pm

The number of states was changed to support more, so the states array isn't the correct size since Unity doesn't automatically re-allocate arrays on a component that is already serialized. So what you'll need to do is reset the component (which unfortunately resets its settings) by clicking on the "gear" icon in the component's inspector, and then click "Reset".
Brady
 
Posts: 5361
Joined: Tue Jul 06, 2010 11:33 pm

Re: [bug]UISlider IndexOutOfRangeException

Postby RussellW » Fri Oct 10, 2014 4:31 pm

k Thanks for the quick response.
RussellW
 
Posts: 4
Joined: Thu Jun 05, 2014 4:32 pm

Re: [bug]UISlider IndexOutOfRangeException

Postby Malveka » Sat Oct 18, 2014 8:21 pm

I've also encountered exactly this issue when updating an older project. In my case I have a large number of sliders in my application. Having to reconfigure all of them is going to be very time consuming and error prone. I tried "Copy Component=>Reset=>Paste Component Values" but this doesn't help.

Do you have any suggestions for automating this process?

Barring that, what would be needed to *safely* disable the new slider knob state, since I don't need it?

Thanks,
James
Malveka
 
Posts: 152
Joined: Sun Jul 11, 2010 1:56 am

Re: [bug]UISlider IndexOutOfRangeException

Postby Brady » Thu Oct 23, 2014 10:49 pm

You might be able to automate it by doing something like adding the following in Start() of UISlider:

Code: Select all
if (states.Length < 6)
{
   List<TextureAnim>() tempStates = new List<TextureAnim>();
   tempStates.AddRange(states);
   tempStates.Add(new TextureAnim("Knob, Disabled"));
   states = tempStates.ToArray();
}


Or perhaps better, add similar code to an editor script that lets you select all the objects with slider components, then have it run over each one, resizing the states array like shown above.
Brady
 
Posts: 5361
Joined: Tue Jul 06, 2010 11:33 pm

Re: [bug]UISlider IndexOutOfRangeException

Postby ibyte » Wed Nov 05, 2014 2:09 pm

HI Brady, I tried adding that code at line 236 to the start section but get - Assets/Plugins/EZ/GUI/Controls/UISlider.cs(238,25): error CS1002: Expecting `;'

EDIT: Checked your other code and found the issue - should be

if (states.Length < 6)
{
List<TextureAnim> tempStates = new List<TextureAnim>();
tempStates.AddRange(states);
tempStates.Add(new TextureAnim("Knob, Disabled"));
states = tempStates.ToArray();
}

and add using System.Collections.Generic; to the file at the top


Glenn
ibyte
 
Posts: 258
Joined: Tue Sep 07, 2010 8:23 pm

Re: [bug]UISlider IndexOutOfRangeException

Postby JPB » Tue Jun 02, 2015 11:46 pm

Hi there!

I had the same problem after updating my existing project. Le line of code in the start menu did the job. Thx a lot!

Although now I am stuck with another bug that I cannot figure out:

transform.localPosition assign attempt for 'Slider1 - Knob' is not valid. Input localPosition is { NaN, NaN, NaN }.
UnityEngine.Transform:set_localPosition(Vector3)
UIScrollKnob:SetPosition(Single) (at Assets/EZ GUI/Plugins/EZ/GUI/Support/UIScrollKnob.cs:159)
UISlider:SetSize(Single, Single) (at Assets/EZ GUI/Plugins/EZ/GUI/Controls/UISlider.cs:464)
SpriteRoot:CalcSize() (at Assets/SM2/Plugins/Sprite Scripts/Support/SpriteRoot.cs:1378)
SpriteRoot:Untruncate() (at Assets/SM2/Plugins/Sprite Scripts/Support/SpriteRoot.cs:1632)
AutoSpriteControlBase:Untruncate() (at Assets/EZ GUI/Plugins/EZ/GUI/Support/AutoSpriteControlBase.cs:330)
SpriteRoot:TruncateRight(Single) (at Assets/SM2/Plugins/Sprite Scripts/Support/SpriteRoot.cs:1544)
AutoSpriteControlBase:TruncateRight(Single) (at Assets/EZ GUI/Plugins/EZ/GUI/Support/AutoSpriteControlBase.cs:313)
UISlider:UpdateAppearance(Single) (at Assets/EZ GUI/Plugins/EZ/GUI/Controls/UISlider.cs:641)
UISlider:UpdateValue() (at Assets/EZ GUI/Plugins/EZ/GUI/Controls/UISlider.cs:589)
UISlider:set_Value(Single) (at Assets/EZ GUI/Plugins/EZ/GUI/Controls/UISlider.cs:58)

...Obviously I seem to have an issue with the knob of my slider but could someone help me understand what I am missing here?

Thx!
JPB
 
Posts: 1
Joined: Tue Jun 02, 2015 11:39 pm

Re: [bug]UISlider IndexOutOfRangeException

Postby Radinka » Thu Jan 19, 2017 12:30 pm

Very good and informative exchange .. Thank you!
Radinka
 
Posts: 8
Joined: Thu Jan 19, 2017 12:21 pm

chanyuan

Postby chanyuan » Tue May 09, 2017 9:49 am

chanyuan2017.05.09
new balance outlet
coach outlet store
longchamp outlet online
christian louboutin sale
cheap ray ban sunglasses
ferragamo outlet
cheap oakley sunglasses
lacoste outlet
christian louboutin shoes
cheap ray ban sunglasses
valentino shoes
coach factory outlet
fitflops
mlb jerseys
polo outlet stores
michael kors outlet online
cheap ray bans
longchamp
oakley sunglasses wholesale
ferragamo shoes
hollister shirts
true religion jeans
nike free running
true religion outlet
michael kors outlet
fitflops sale clearance
chrome hearts outlet
vans outlet
yeezy boost
pandora charms sale clearance
coach outlet
mont blanc pens
true religion canada
nba jerseys
true religion jeans outlet
michael kors outlet clearance
michael kors outlet clearance
ray bans
los angeles lakers
oakley sunglasses wholesale
cheap oakley sunglasses
omega outlet
polo outlet
polo ralph lauren
fitflops sale clearance
michael kors handbags
rolex outlet
adidas wings shoes
coach factory outlet
pandora outlet
nike blazer pas cher
coach outlet online
ralph lauren outlet
michael kors outlet clearance
louis vuitton outlet online
ralph lauren polo
michael kors outlet
jordan 4
kate spade uk
mlb jerseys
ralph lauren outlet
ralph lauren
coach outlet
air max 90
coach outlet
adidas outlet
louis vuitton outlet stores
michael kors handbags
coach outlet online
swarovski jewelry
rolex watches outlet
cheap jordan shoes
ralph lauren
lacoste shirts
ralph lauren outlet
ralph lauren outlet
cheap oakley sunglasses
cheap oakley sunglasses
nike shoes uk
air force 1 shoes
cheap ray ban sunglasses
coach outlet store online
coach outlet online
cartier watches for women
polo ralph lauren
mulberry outlet,mulberry handbags outlet
camisetas futbol baratas
cheap football shirts
louis vuitton outlet
ed hardy outlet
kd shoes
coach outlet online coach factory outlet
polo ralph lauren
hermes birkin bag
louis vuitton handbags
kobe 9 elite
polo ralph lauren outlet
michael kors handbags clearance
louis vuitton outlet online
converse shoes sale
louis vuitton outlet
michael kors outlet store
nike trainers uk
oakley sunglasses sale
louis vuitton
oakley sunglasses wholesale
rolex watches for sale
prada outlet
michael kors outlet
cheap mlb jerseys
ferragamo outlet
ralph lauren outlet
mulberry handbags
adidas shoes
mcm outlet
longchamp outlet
prada sunglasses for women
cheap ray ban sunglasses
coach outlet
coach outlet online
ralph lauren polo
oakley sunglasses wholesale
soccer cleats
polo ralph lauren
polo ralph lauren
coach factory outlet
coach outlet online
jerseys wholesale
true religion jeans sale
cheap oakley sunglasses
ray ban sunglasses outlet
ralph lauren
nfl jerseys
louis vuitton outlet online
ray ban sunglasses
michael kors canada
louis vuitton outlet
burberry outlet store
coach outlet online
oakley sunglasses wholesale
louis vuitton
louis vuitton outlet
louis vuitton
christian louboutin sale
coach factory outlet
mizuno shoes
cheap oakley sunglasses
coach outlet
nike outlet store
mulberry handbags
polo ralph lauren outlet
mac cosmetics sale
coach outlet
nike shoes for women
christian louboutin
louis vuitton outlet
fitflops
fred perry polo
coach outlet store online
christian louboutin
true religion outlet
nike trainers
tory burch outlet online
cazal outlet
michael kors outlet online
michael kors outlet
ralph lauren outlet stores
michael kors outlet clearance
michael kors outlet
cheap nfl jerseys
coach outlet
giuseppe zanotti shoes
cheap oakley sunglasses
nike trainers
prada outlet
gucci outlet
cheap oakley sunglasses
oakley sunglasses
tory burch outlet online
ray ban sunglasses
coach outlet online
longchamp handbags
coach factory outlet
true religion outlet uk
michael kors handbags
louis vuitton uk
coach outlet clearance
nike shoes
tory burch outlet online store
air max 2015
pandora jewellery
gucci outlet store
cartier outlet
ray-ban sunglasses
michael kors outlet stores
gucci outlet online
michael kors factory outlet
louis vuitton outlet online
herve leger dresses
polo ralph lauren
coach outlet online coach factory outlet
michael kors outlet clearance
nhl jerseys
louis vuitton
polo shirts
coach outlet
nfl jersey
michael kors outlet clearance
coach outlet online
rolex watches,rolex replica watches,replica rolex watches,replica watches
thomas sabo charms
michael kors outlet clearance
burberry canada
tory burch outlet stores
puma shoes
hollister shirts
ray-ban sunglasses
louis vuitton outlet stores
coach outlet store online
polo ralph lauren outlet
coach outlet
michael kors outlet online
michael kors outlet clearance
coach outlet
juicy couture tracksuit
coach outlet store online
fitflops sale clearance
roshe run
louis vuitton
louis vuitton outlet online
swarovski uk
oakley sunglasses wholesale
air max 90
true religion outlet
ray ban sunglasses wholesale
longchamp outlet
coach outlet
louis vuitton outlet
michael kors handbags outlet
cheap oakley sunglasses
coach outlet
ray ban sunglasses
adidas nmd runner
cheap oakley sunglasses
louis vuitton outlet store
louis vuitton outlet
cheap ray ban sunglasses
louis vuitton
cheap ray ban sunglasses
true religion jeans
longchamp
snapbacks wholesale
michael kors outlet clearance
gucci outlet online
michael kors outlet online
mulberry handbags sale
michael kors outlet
lebron shoes
ralph lauren outlet
ysl outlet online
michael kors outlet online
cheap oakley sunglasses
pandora outlet
louis vuitton bags
coach outlet online
birkenstock shoes
polo outlet stores
fitflops uk
rolex watches
michael kors outlet online
pandora jewelry
kobe bryants shoes
christian louboutin outlet
cheap jordans for sale
louis vuitton
christian louboutin outlet
fitflops uk
cheap jordan shoes
true religion jeans
ferragamo shoes
louis vuitton outlet
links of london jewellery
michael kors outlet online
kobe shoes
polo outlet store
true religion outlet
salomon outlet
cheap jordan shoes
louis vuitton
mulberry handbags sale
coach outlet
nike air huarache
tory burch outlet online
tods outlet online
coach outlet online
ray ban wayfarer
cheap oakley sunglasses
michael kors outlet clearance
ralph lauren uk
longchamp handbags
nike uk store
coach factory outlet
rolex watches,rolex watches,swiss watches,watches for men,watches for women,omega watches,replica watches,rolex watches for sale,rolex replica,rolex watch,cartier watches,rolex submariner,fake rolex,rolex replica watches,replica rolex
ray ban sunglasses
cheap jerseys wholesale
chrome hearts
cheap replica watches
nfl jerseys
mcm handbags
cheap jordans
true religion jeans
nfl jersey wholesale
supra shoes sale
coach factory outlet
fitflops
michael kors uk
michael kors outlet clearance
polo pas cher
coach outlet online
soccer jerseys wholesale
tory burch outlet
cheap ray ban sunglasses
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
basketball shoes,basketball sneakers,lebron james shoes,sports shoes,kobe bryant shoes,kobe sneakers,nike basketball shoes,running shoes,mens sport shoes,nike shoes
instyler
ralph lauren outlet
swarovski outlet
reebok shoes
burberry outlet store
coach outlet online
gucci outlet online
adidas uk store
cartier watches for sale
beats headphones
coach outlet
coach outlet online
michael kors uk
hollister clothing store
fitflops sale clearance
ralph lauren shirts
christian louboutin shoes
michael kors outlet
cheap soccer jerseys
nfl jersey wholesale
cartier watches for sale
michael kors outlet
reebok shoes
mulberry bags
oakley sunglasses wholesale
cartier watches
louis vuitton outlet
oakley sunglasses sale
louis vuitton
cheap oakley sunglasses
kate spade uk
polo outlet
louis vuitton borse
sac louis vuitton pas cher
cheap nba jerseys
rolex orologi
nike air huarache
rolex watches
nike roshe run
ferragamo shoes sale
michael kors outlet clearance
hollister
nike outlet online
coach outlet online
burberry outlet sale
true religion uk
ralph lauren polo
christian louboutin outlet
michael kors outlet
coach outlet online
cheap oakley sunglasses
iphone case uk
cheap oakley sunglasses
coach outlet
oakley sunglasses wholesale
christian louboutin shoes
ralph lauren
coach outlet store online
foamposite shoes
ferragamo shoes
oakley sunglasses wholesale
mulberry uk
air max 90
ralph lauren uk
true religion jeans
tory burch outlet online
oakley sunglasses wholesale
cheap jordans free shipping
cheap nike shoes
michael kors outlet online
oakley sunglasses
coach outlet online
yeezy boost 350
bottega veneta outlet online
mulberry outlet
coach outlet clearance
oakley sunglasses
marc jacobs sale
michael kors outlet
michael kors wallets for women
christian louboutin uk
coach outlet
hermes outlet
hermes belts
hermes outlet store
oakley sunglasses wholesale
ferragamo outlet
michael kors handbags
kate spade
coach factory outlet
louis vuitton handbags
michael kors outlet online
mont blanc outlet
oakley sunglasses sale
coach outlet store online
tory burch outlet online
louis vuitton outlet stores
lebron shoes
ralph lauren outlet
cheap ray ban sunglasses
longchamp handbags
ray ban sunglasses outlet
louis vuitton handbags
prada outlet online
coach outlet online
michael kors outlet online
swarovski jewellery
coach handbags outlet
oakley sunglasses sale
nike air max 90
mbt shoes outlet
cheap oakley sunglasses
gucci outlet online
nhl jerseys wholesale
air max 90
polo outlet
coach outlet store online
rolex uk
cheap oakley sunglasses
coach factory outlet
cleveland cavaliers jerseys
beats by dre
ecco outlet
nike store uk
coach outlet clearance
louis vuitton uk
nike outlet store online
christian louboutin shoes
coach outlet online
michael kors uk
oakley sunglasses wholesale
polo ralph lauren outlet
beats by dre
coach outlet
cheap ray bans
polo outlet online
michael kors outlet
adidas nmd
ralph lauren uk
ray ban sunglasses uk
cheap ray ban sunglasses
coach outlet
polo ralph lauren
nike roshe run
swarovski crystal
cheap ray ban sunglasses
louis vuitton
michael kors uk
coach outlet clearance
swarovski crystal
christian louboutin shoes
polo ralph lauren
gucci borse
nba jerseys wholesale
beats headphones
ray ban sunglasses uk
birkenstock shoes
gucci bags
coach outlet clearance
chanyuan
 
Posts: 298
Joined: Tue May 09, 2017 9:06 am

Next

Return to EZ GUI General

Who is online

Users browsing this forum: Bing [Bot] and 3 guests