Support => NGUI 3 Support => Topic started by: LennDolling on December 13, 2013, 10:15:24 PM
Title: StackOverflowException 3.07 UIRect
Post by: LennDolling on December 13, 2013, 10:15:24 PM
3.0.7 f3
I created a sprite to use as a mask for a flashlight.... and I am needing to have the sprite move infront of the gameworld as I touch the screen to mask the world.... but in doing so when I update the transform sprite during runtime to any position besides 0,0,0 the values get out of wack...
in trying to perhaps put the sprite on a panel first and then manipulate the transform from the panel has created a stack overflow....
Panel-- -Sprite
I dragged the sprite object onto the panel... and poOf
Title: Re: StackOverflowException 3.07 UIRect
Post by: ArenMook on December 14, 2013, 03:56:09 AM
Curious. You're ending up with a cyclic dependency here. I'd be curious to know how I can go about reproducing it on my end. I'd also be curious to know if changing UIRect.OnValidate function to the following would fix it:
protectedvirtualvoid OnValidate()
{
OnDisable();
ResetAnchors();
Invalidate(true);
OnEnable();
}
Title: Re: StackOverflowException 3.07 UIRect
Post by: LennDolling on December 14, 2013, 05:29:52 PM
I will change it on my end and see if it goes away... sweet fast response.... since the issue with getting the sprite to move during a game event was not happening I decided to just make a simple plane and write a script to go infront of the camera seemed to make a nice flashlight proof of concept first try at it....*cough second....
I will update ... I am not sure if the method I am doing is the most effective method..
first preview video of the game I am putting together
youtube video of ngui + 2dtoolkit + smoothmoves + 2dColliderGen http://www.youtube.com/watch?v=dvUCpCm1Qa4 (http://www.youtube.com/watch?v=dvUCpCm1Qa4)
Update: just added code and did a test...
http://youtu.be/aOblLCECMls
video shows the issue....
could be how I created the sprite object as just to a base of the camera... then dragged it to the panel...
in the second run after deleting the code and removing the panel... all the atlas's turned to the pink... as I remember a long time ago.... I just saved everything and restarted unity and things where back to normal.
Title: Re: StackOverflowException 3.07 UIRect
Post by: ArenMook on December 14, 2013, 07:22:27 PM
Well, I added code that exits out early in the latest Pro version, so the issue will be gone on its own.
Title: Re: StackOverflowException 3.07 UIRect
Post by: LennDolling on December 16, 2013, 12:29:41 PM