I am currently in Unity 5.2.1f1 and I am stumped. Lately I have been learning anchors and trying to get my UI to scale nicely across multiple resolutions. I wrote myself an editor script to make this easier and more precise, and to help the anchors snap to the corners of its own rectTransform. This script uses transform.parent.gameObject.GetComponent().sizeDelta and this is where the problem lies.
When I run this script on a gameObject that is the child of an object that contains a scrollRect and a Mask (I don’t know which causes the problem), sizeDelta returns 0 every time. Is there any way around this? Are there any alternative ways to query the width and height of a parent’s rectTransform?