protected override void OnEnable() { base.OnEnable(); TextComponent = (QText)target; key = serializedObject.FindProperty("key"); }
public static QText AddComponent() { QText component = UtilityEditor.ExtensionComponentWhenCreate <QText>(typeof(QText).Name.ToString()); //设置默认值 SetDefaultValue(component); return(component); }
private static void SetDefaultValue(QText component) { if (component == null) { return; } component.font = DefaultFont; component.supportRichText = false; component.raycastTarget = false; component.alignment = TextAnchor.MiddleCenter; component.horizontalOverflow = HorizontalWrapMode.Overflow; component.color = Color.black; component.fontSize = 18; component.text = "QText"; }
public override void GeneratePathEditor() { //==自动化路径开始 QText_Title = CacheTransform.Find("Center/QText_Title/").GetComponent <QText>(); QButton_Close = CacheTransform.Find("Center/ButtonGroup/QButton_Close/").GetComponent <QButton>(); }