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 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); }