Пример #1
0
        protected override void OnEnable()
        {
            base.OnEnable();

            TextComponent = (QText)target;
            key           = serializedObject.FindProperty("key");
        }
Пример #2
0
        public static QText AddComponent()
        {
            QText component = UtilityEditor.ExtensionComponentWhenCreate <QText>(typeof(QText).Name.ToString());

            //设置默认值
            SetDefaultValue(component);
            return(component);
        }
Пример #3
0
 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";
 }