private static void SetParentAndAlign(GameObject child, GameObject parent)
 {
     if (!(parent == null))
     {
         child.transform.SetParent(parent.transform, false);
         UIControls.SetLayerRecursively(child, parent.layer);
     }
 }
        private static void SetLayerRecursively(GameObject go, int layer)
        {
            go.layer = layer;
            Transform transform = go.transform;

            for (int i = 0; i < transform.childCount; i++)
            {
                UIControls.SetLayerRecursively(transform.GetChild(i).gameObject, layer);
            }
        }