示例#1
0
    public static UIText CreateComponent()
    {
        UIText component = UtilEditor.ExtensionComponentWhenCreate <UIText>(typeof(UIText).Name.ToString());

        //设置默认值
        SetDefaultValue(component);
        return(component);
    }
示例#2
0
        public static UIRawImage AddComponent()
        {
            UIRawImage component = UtilEditor.ExtensionComponentWhenCreate <UIRawImage>(typeof(UIRawImage).Name.ToString());

            //设置默认值
            SetDefaultValue(component);
            return(component);
        }
示例#3
0
    public static UIButton AddComponent()
    {
        UIButton component = UtilEditor.ExtensionComponentWhenCreate <UIButton>(typeof(UIButton).Name.ToString());
        UIImage  image     = UtilEditor.GetOrAddCompoment <UIImage>(component.gameObject);

        component.targetGraphic = image;
        //设置默认值
        SetDefaultValue(component);
        return(component);
    }
    public static UITagButtonGroup AddComponent()
    {
        UITagButtonGroup component = UtilEditor.ExtensionComponentWhenCreate <UITagButtonGroup>(typeof(UITagButtonGroup).Name.ToString());

//            component.list.Clear();
//
//            for (int i = 0; i < 2; i++)
//            {
//                Selection.activeObject = component;
//                QToggleButton button = QToggleButtonEditor.AddComponent();
//                component.list.Add(button);
//            }
//            Selection.activeObject = component;
        return(component);
    }
示例#5
0
    public static new UITagButton AddComponent()
    {
//            QImageBox image = QImageBoxEditor.AddComponent();
//            image.raycastTarget = true;
//
//            QToggleButton component = Util.GetOrAddCompoment<QToggleButton>(image.CacheGameObject);
//            component.name = typeof(QToggleButton).Name.ToString();
        //设置默认值
        UITagButton component =
            UtilEditor.ExtensionComponentWhenCreate <UITagButton>(typeof(UITagButton).Name.ToString());
        UIImage image = UtilEditor.GetOrAddCompoment <UIImage>(component.gameObject);

        component.targetGraphic = image;
        SetDefaultValue(component);
        return(component);
    }