Support => NGUI 3 Support => Topic started by: aholla on May 23, 2014, 09:50:56 AM
Title: Get the current Camera
Post by: aholla on May 23, 2014, 09:50:56 AM
Hi, I would like to get the current camera so I can tween a panel in from outside the camera view/bounds.
I have tried various methods: UICamera.current return null, NGUITools.FindInParents<UICamera>( gameObject ) returns null.
To make things a little more confusing I have two UIRoots and therefore two UICamera.
UIRoot1 - UIPanel - UICamera
UIRoot2 -UIPanel -UICamera
SO just to reiterate what I am doing. In code I am trying to tween an existing object in the hierarchy. I want to position it outside the view of the camera and tween/slide it in.
Any suggestions?
Also related to my issues I have managed to get my panel to appear offscreen with the following code:
int paneloffset = Mathf.FloorToInt( UIRoot.GetPixelSizeAdjustment( gameObject )*( Screen.width/ 2f ))+1;