| | |
| | | SetParent(instance); |
| | | } |
| | | |
| | | [MenuItem("GameObject/UI/渐变文本")] |
| | | public static void CreateGradientText() |
| | | { |
| | | var instance = new GameObject("GradientText"); |
| | | var text = instance.AddComponent<GradientText>(); |
| | | text.font = FontUtility.preferred; |
| | | text.fontSize = 22; |
| | | text.alignment = TextAnchor.MiddleCenter; |
| | | text.raycastTarget = false; |
| | | text.horizontalOverflow = HorizontalWrapMode.Overflow; |
| | | text.verticalOverflow = VerticalWrapMode.Overflow; |
| | | SetParent(instance); |
| | | } |
| | | |
| | | [MenuItem("GameObject/UI/TextEx")] |
| | | public static void CreateTextEx() |
| | | { |
| | |
| | | public static void CreateButtonEx() |
| | | { |
| | | var button = UIUtility.CreateWidget("CommonButton", "CommonButton"); |
| | | var buttonEx = button.GetComponent<ButtonEx>(); |
| | | buttonEx.interval = 0.1f; |
| | | buttonEx.pressedScale = 1.05f; |
| | | SetParent(button); |
| | | } |
| | | |