| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [Author]: 玩个游戏 |
| | | // [ Date ]: Tuesday, October 31, 2017 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using vnxbqy.UI; |
| | | |
| | | |
| | | public class PrefabCreateTool |
| | |
| | | [MenuItem("GameObject/UI/特效")] |
| | | public static void CreateUIEffect() |
| | | { |
| | | var instance = new GameObject("UIEffect"); |
| | | instance.AddComponent<UIEffect>(); |
| | | var instance = new GameObject("UIEffectPlayer"); |
| | | instance.AddComponent<UIEffectPlayer>(); |
| | | instance.AddComponent<RectTransform>(); |
| | | SetParent(instance); |
| | | } |
| | |
| | | public static void CreateTextEx() |
| | | { |
| | | var instance = new GameObject("TextEx"); |
| | | instance.AddComponent<TextEx>(); |
| | | var text = instance.AddComponent<TextEx>(); |
| | | text.font = FontUtility.preferred; |
| | | text.fontSize = 22; |
| | | text.alignment = TextAnchor.MiddleCenter; |
| | | text.raycastTarget = false; |
| | | SetParent(instance); |
| | | } |
| | | |
| | |
| | | public static void CreateImageEx() |
| | | { |
| | | var instance = new GameObject("ImageEx"); |
| | | instance.AddComponent<ImageEx>(); |
| | | var image = instance.AddComponent<ImageEx>(); |
| | | image.raycastTarget = false; |
| | | SetParent(instance); |
| | | } |
| | | |
| | |
| | | SetParent(button); |
| | | } |
| | | |
| | | [MenuItem("GameObject/UI/SecondFrameLoad")] |
| | | [MenuItem("GameObject/UI/二级框")] |
| | | public static void CreateSecondFrameLoad() |
| | | { |
| | | var prefab = LoadUIPattern("SecondFrameLoad"); |