| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | SetParent(button); |
| | | } |
| | | |
| | | [MenuItem("GameObject/UI/二级框")] |
| | | [MenuItem("GameObject/UI/二级底框")] |
| | | public static void CreateSecondFrameLoad() |
| | | { |
| | | var prefab = LoadUIPattern("SecondFrameLoad"); |
| | |
| | | SetParent(instance); |
| | | } |
| | | |
| | | [MenuItem("GameObject/UI/二级带功能框")] |
| | | public static void CreateSecondLevelWin() |
| | | { |
| | | var prefab = UIUtility.CreateWidget("SecondLevelWin", "Panel"); |
| | | SetParent(prefab); |
| | | var rectTransform = prefab.GetComponent<RectTransform>(); |
| | | // 完全填充父容器 |
| | | rectTransform.anchorMin = Vector2.zero; |
| | | rectTransform.anchorMax = Vector2.one; |
| | | rectTransform.sizeDelta = Vector2.zero; |
| | | |
| | | } |
| | | } |
| | | |
| | | |