Hi all, thanks for taking the time to look at my issue.
This is kind of a 2 part question. As I been having some issues with my UIPanles not rendering correctly in the 'Game' window within Unity after pressing play.
So every time a menu (UIPanel and NGUI widgets as children) is created within my project I add these to a stack so I can loop over and update the depths and position of these menus in run time.
Issue (1):
For some reason I am having to move my menus by 120 in the Z axis. (Just confirming: this is 120 pixels away from the camera).
If they are closer to the camera than the number above, they will not render within the 'Game' window within Unity.
Issue (2):
During run time, when I create a new menu I again loop over both menus and change the position so both menus can be seen/rendered within the 'Game' window.
My problem is that when I create a second menu the menus seem to transform to 43200 in the Z axis.
Here is the code which changes the menus position in the Z axis:
// Get the current menus position
Vector3 position = newMenu.gameObject.transform.position;
// Create the menus new position by changing the Z axis, when this.__offset = 120
Vector3 newPosition
= new Vector3
(position
.x, position
.y,
this.__offset
);// Apply the the menus new position
newMenu.gameObject.transform.position = newPosition;
Here is a screen shot of the Debug.Logs showing the newMenu.gameObject.transform.position after I have set it. So it seems that something is moving my UIPanels after I have set it where I want it to be.
I would really appreciate any feedback to do with either or both of these issues if anyone has run across them, or something similar, before and know of a mistake that I might me doing or a solution to fix these issues.
Thanks for your time, and Merry Christmas to all
Erbacher