Esempio n. 1
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);
    }
Esempio n. 2
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);
    }