InvexGames / MaterialUI

MaterialUI is a UI kit for Unity that follows Google's official material design guidelines.
http://invexgames.com/materialUI.html
Other
771 stars 200 forks source link

EZAnim - Object reference not set to an instance of an object #43

Open DrabWeb opened 9 years ago

DrabWeb commented 9 years ago

I've been using EZAnim a lot lately, and for quite a while, but randomly now I get this error when trying to use (EZAnim Variable).Animate(); or (EZAnim Variable).AnimateAll();

NullReferenceException: Object reference not set to an instance of an object
MaterialUI.EZAnim.AnimStruct (Int32 i) (at Assets/MaterialUI/Scripts/EZAnim.cs:67)
MaterialUI.EZAnim.AnimateAll () (at Assets/MaterialUI/Scripts/EZAnim.cs:136)

This randomly happens on random triggers, with them occasionally fixing themselves for no apparent reason. I looked into the error a bit, and at line 67 in EZAnim.cs, it has this

activeList[i] = true;

Now I did some digging and the variable that it is looking for is there, as far as I know. My best guess is it is throwing the AnimStruct function a bad number, making it look for a variable that doesn't exist. If you could help me fix this that would be great!

Thanks, DrabWeb

InvexGames commented 9 years ago

I'll definitely take a look when I can and try and fix that up. Eventually I'd really like to overhaul EZAnim and make it more powerful and easier to use. I think it has to the potential to be a brilliant UI animation tool.

Thanks for letting me know :)

InvexGames commented 9 years ago

Hi! Thanks for bringing this issue to my attention :)

I'm now working on MaterialUI in a private repo, adding features and the likes for an official release on the Asset Store - this means that I won't be adding/fixing anything more in this repo (sorry). Feel free to fork this one if you'd like to tackle to issue yourself, and/or send me an email at invex@invexgames.com if you want me to let you know when it's available.

Cheers, Declan.

wilk3ns commented 9 years ago

Hi, maybe you are calling the code too early, I used to get that problem because tried to run code inside OnEnable() method, after I've invoked my animation method inside OnEnable method with .1f units of delay, and everything worked perfectly. Hope that helps!