Ejemplo n.º 1
0
 public static void CreatePopupItem(Transform popup_transform, Transform parent_ctrl, int max_num, ATTACH_DIRECTION direction, bool adjust_size, Transform item_prefab, string[] texts, bool[] button_enable, int select_index, Action <int> callback = null)
 {
     //IL_002a: Unknown result type (might be due to invalid IL or missing references)
     firstItemIsTextOnly = true;
     _CreatePopup(popup_transform, parent_ctrl, max_num, direction, adjust_size, item_prefab, texts, button_enable, select_index, callback);
     if (item_prefab != null)
     {
         Object.DestroyImmediate(item_prefab.get_gameObject());
     }
 }
Ejemplo n.º 2
0
    private static void _CreatePopup(Transform popup_transform, Transform parent_ctrl, int max_num, ATTACH_DIRECTION direction, bool adjust_size, Transform item_prefab, string[] texts, bool[] button_enable, int select_index, Action <int> callback = null)
    {
        //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
        if (!(popup_transform == null) && !(parent_ctrl == null))
        {
            UIWidget component = parent_ctrl.GetComponent <UIWidget>();
            if (!(component == null))
            {
                float num  = 0f;
                float num2 = 0f;
                switch (direction)
                {
                case ATTACH_DIRECTION.BOTTOM:
                    num2 = (float)(-component.height / 2);
                    break;

                case ATTACH_DIRECTION.LEFT:
                    num  = (float)(-component.width);
                    num2 = (float)(component.height / 2);
                    break;

                case ATTACH_DIRECTION.RIGHT:
                    num  = (float)component.width;
                    num2 = (float)(component.height / 2);
                    break;
                }
                popup_transform.set_parent(parent_ctrl);
                popup_transform.set_localPosition(new Vector3(num, num2, 0f));
                popup_transform.set_localScale(Vector3.get_one());
                UIScrollablePopupList component2 = popup_transform.GetComponent <UIScrollablePopupList>();
                if (adjust_size)
                {
                    component2.minPopFrameWidth = component.width;
                }
                component2.maxItemNum = max_num;
                component2.SetItem(item_prefab, texts, button_enable, select_index, callback);
            }
        }
    }
Ejemplo n.º 3
0
 public static void CreatePopup(Transform popup_transform, Transform parent_ctrl, int max_num, ATTACH_DIRECTION direction, bool adjust_size, string[] texts, bool[] button_enable, int select_index, Action <int> callback = null)
 {
     _CreatePopup(popup_transform, parent_ctrl, max_num, direction, adjust_size, null, texts, button_enable, select_index, callback);
 }