Hi~ I’m using UGUI(Unity 4.6) on my project.
I don’t know how to get to the center position of the UGUI.
For example, the figure below.
First I tried using the RectTransform.rect.center.
However, the result is always (0, 0). (An even shift the ‘ImageObject’ in the figure above, the position (0, 0).)
Secondly tried using the CanvasRenderer.
But when I getComponent the CanvasRenderer 'null reference, an error has occurred.
. CanvasRenderer renderer = GameObject.Find (“ImageObject”) getComponent ();
The above code has caused a null reference.
How Would I can get the center position of the UGUI?