示例#1
0
 public static String ResolveContainerLayout(ContainerLayoutType layoutType)
 {
     switch (layoutType)
     {
         case ContainerLayoutType.Fixed:
             return "container-fixed";
         case ContainerLayoutType.Fluid:
             return "container";
     }
     return "container";
 }
示例#2
0
        public static String ResolveContainerLayout(ContainerLayoutType layoutType)
        {
            switch (layoutType)
            {
            case ContainerLayoutType.Fixed:
                return("container-fixed");

            case ContainerLayoutType.Fluid:
                return("container");
            }
            return("container");
        }
示例#3
0
        public static TUIContainer Create(ContainerLayoutType layout, LayoutElementData element = null)
        {
            TUIContainer container = createBaseWidget <TUIContainer>(element);

            switch (layout)
            {
            case ContainerLayoutType.Grid:
            {
                container.gameObject.AddComponent <GridLayoutGroup>();
                break;
            }

            case ContainerLayoutType.Horizontal:
            {
                container.gameObject.AddComponent <HorizontalLayoutGroup>();
                break;
            }

            case ContainerLayoutType.Vertical:
            {
                container.gameObject.AddComponent <VerticalLayoutGroup>();
                break;
            }

            case ContainerLayoutType.None:
            {
                // intentionally empty
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException(nameof(layout), layout, "Layout type not found!");
            }
            }

            container.LayoutType = layout;
            return(container);
        }