static void FindAnchor() { object[] objs = Selection.objects; if (objs.Length == 1) { GameObject obj = objs[0] as GameObject; UIRect[] uiRects = obj.transform.GetComponentsInChildren <UIRect>(); for (int i = 0, len = uiRects.Length; i < len; i++) { UIRect uiRect = uiRects[i]; if (uiRect.isAnchored && uiRect.updateAnchors == UIRect.AnchorUpdate.OnUpdate) { Debug.LogError("FindAnchor at " + uiRect.ToString() + " (点击定位)", uiRect); } } } }