| | |
| | | // [ Date ]: Wednesday, January 10, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEditor; |
| | | using vnxbqy.UI; |
| | | |
| | | [CustomEditor(typeof(PositionTween))] |
| | | public class PositionTweenEditor : TweenEditor |
| | |
| | | // [ Date ]: Wednesday, January 10, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEditor; |
| | | using vnxbqy.UI; |
| | | |
| | | [CustomEditor(typeof(RotationTween))] |
| | | public class RotationTweenEditor : TweenEditor |
| | |
| | | // [ Date ]: Wednesday, January 10, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEditor; |
| | | using vnxbqy.UI; |
| | | |
| | | [CustomEditor(typeof(ScaleTween))] |
| | | public class ScaleTweenEditor : TweenEditor |
| | |
| | | |
| | | using vnxbqy.UI; |
| | | using UnityEditor; |
| | | using UnityEngine; |
| | | |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEditor; |
| | | using vnxbqy.UI; |
| | | |
| | | [CustomEditor(typeof(Tween))] |
| | | public class TweenEditor : Editor |
| | |
| | | //检查window界面里是否引用了builtin里的图片
|
| | | public class ExportPrefabsNoBuiltin : EditorWindow { |
| | | |
| | | private static string topFilePath= "Assets/ResourcesOut/UI/Window/"; |
| | | private static string topFilePath= "Assets/ResourcesOut/UI/"; |
| | |
|
| | |
|
| | |
|
| | |
| | | |
| | | public class IconRepetitionCheck : MonoBehaviour |
| | | { |
| | | static string rootPath = Application.dataPath + "/ResourcesOut/UI/Sprite"; |
| | | static string spriteRelativePath = "Assets/ResourcesOut/UI/Sprite/"; |
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Sprite"; |
| | | static string spriteRelativePath = "Assets/ResourcesOut/Sprite/"; |
| | | static Dictionary<long, List<string>> referenceResourceSizeAndNames = new Dictionary<long, List<string>>(); |
| | | |
| | | [MenuItem("程序/Sprite/Sprite重复性检查")] |
| | |
| | | if (InGameDownTestUtility.enable)
|
| | | {
|
| | | VersionConfig.Get().assetAccess = InstalledAsset.NullAsset;
|
| | | AssetSource.allFromEditor = false;
|
| | | AssetSource.builtInFromEditor = true;
|
| | | AssetSource.shaderFromEditor = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | VersionConfig.Get().assetAccess = InstalledAsset.IngoreDownLoad;
|
| | | AssetSource.allFromEditor = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | using UnityEditor; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using vnxbqy.UI; |
| | | |
| | | |
| | | public class PrefabCreateTool |
| | |
| | | public class UpdateSpriteSetting
|
| | | {
|
| | |
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/UI/Sprite";
|
| | | static string spriteRelativePath = "Assets/ResourcesOut/UI/Sprite";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Sprite";
|
| | | static string spriteRelativePath = "Assets/ResourcesOut/Sprite";
|
| | |
|
| | | public static void SetRechargeSkin(int pattern)
|
| | | {
|
| | | var toDirectory = Application.dataPath + "/ResourcesOut/UI/Sprite/Recharge";
|
| | | var toDirectory = Application.dataPath + "/ResourcesOut/Sprite/Recharge";
|
| | | var oldFiles = new DirectoryInfo(toDirectory).GetFiles("*.png", SearchOption.AllDirectories);
|
| | | foreach (var item in oldFiles)
|
| | | {
|
| | |
| | | {
|
| | | var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/sprite/" + file.Name.Split(".")[0].ToLower();
|
| | | importer.assetBundleName = "sprite/" + file.Name.Split(".")[0].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | var pathStringArray = file.DirectoryName.Split(Path.DirectorySeparatorChar);
|
| | | var importerPath = spriteRelativePath + Path.DirectorySeparatorChar + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | importer.assetBundleName = "sprite/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public class UpdateUIWindowSetting
|
| | | {
|
| | | static string assetRelativePath = "Assets/ResourcesOut/UI/Window";
|
| | | static string assetRelativePath2 = "Assets/ResourcesOut/UI/PriorityWindow";
|
| | | static string assetRelativePath = "Assets/ResourcesOut/UI";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Window(All) AssetBundleName")]
|
| | | public static void SetAllUIWindowAssetBundleName()
|
| | |
| | | {
|
| | | var path = AssetDatabase.GUIDToAssetPath(guid);
|
| | | var importer = AssetImporter.GetAtPath(path);
|
| | | importer.assetBundleName = "ui/window";
|
| | | importer.assetBundleName = "ui";
|
| | |
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | guids = AssetDatabase.FindAssets("t:prefab", new string[] { assetRelativePath2 });
|
| | | foreach (var guid in guids)
|
| | | {
|
| | | var path = AssetDatabase.GUIDToAssetPath(guid);
|
| | | var importer = AssetImporter.GetAtPath(path);
|
| | | importer.assetBundleName = StringUtility.Contact("ui/prioritywindow/", Path.GetFileNameWithoutExtension(path).ToLower());
|
| | |
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | Debug.Log("Window资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | |
| | |
|
| | | public class UpdateUIPrefabSetting
|
| | | {
|
| | | static string prefabRootPath = Application.dataPath + "/ResourcesOut/UI/Prefab";
|
| | | static string prefabAssetRelativePath = "Assets/ResourcesOut/UI/Prefab";
|
| | | static string prefabRootPath = Application.dataPath + "/ResourcesOut/Prefab";
|
| | | static string prefabAssetRelativePath = "Assets/ResourcesOut/Prefab";
|
| | |
|
| | | static string bossShowRootPath = Application.dataPath + "/ResourcesOut/UI/BossShow";
|
| | | static string bossShowAssetRelativePath = "Assets/ResourcesOut/UI/BossShow";
|
| | |
|
| | | static string godWeaponRootPath = Application.dataPath + "/ResourcesOut/UI/GodWeapon";
|
| | | static string godWeaponAssetRelativePath = "Assets/ResourcesOut/UI/GodWeapon";
|
| | |
|
| | | static string treasureRootPath = Application.dataPath + "/ResourcesOut/UI/Treasure";
|
| | | static string treasureAssetRelativePath = "Assets/ResourcesOut/UI/Treasure";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Prefab(All) AssetBundleName")]
|
| | | public static void SetAllUIPrefabAssetBundleName()
|
| | |
| | | {
|
| | | var importerPath = prefabAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/prefab";
|
| | | importer.assetBundleName = "prefab";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(bossShowRootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = bossShowAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/bossshow";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(godWeaponRootPath).GetFiles("*.prefab", SearchOption.TopDirectoryOnly);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var importerPath = godWeaponAssetRelativePath + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/godweapon";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | | allFiles = new DirectoryInfo(treasureRootPath).GetFiles("*.prefab", SearchOption.AllDirectories);
|
| | | foreach (var file in allFiles)
|
| | | {
|
| | | var pathStringArray = file.DirectoryName.Split(Path.DirectorySeparatorChar);
|
| | | var importerPath = treasureAssetRelativePath + Path.DirectorySeparatorChar + pathStringArray[pathStringArray.Length - 1] + Path.DirectorySeparatorChar + file.Name;
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "ui/treasure/" + pathStringArray[pathStringArray.Length - 1].ToLower();
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | | |
| | | Debug.Log("Prefab资源包名更新完成!");
|
| | | // AssetDatabase.SaveAssets();
|
| | | // AssetDatabase.Refresh();
|
| | |
| | | |
| | | public class UpdateSpritePackingSetting
|
| | | { |
| | | static string rootPath = Application.dataPath + "/ResourcesOut/UI/Sprite"; |
| | | static string spriteRelativePath = "Assets/ResourcesOut/UI/Sprite";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Sprite"; |
| | | static string spriteRelativePath = "Assets/ResourcesOut/Sprite";
|
| | |
|
| | | [MenuItem("程序/Sprite/标准化Sprite设置")] |
| | | public static void UpdateAllSpritePackingSetting()
|
| | |
| | |
|
| | | if (!Directory.Exists(directoryPath))
|
| | | {
|
| | | return;
|
| | | continue;
|
| | | }
|
| | |
|
| | | var files = new DirectoryInfo(directoryPath).GetFiles("*.png", SearchOption.TopDirectoryOnly);
|
| | |
| | |
|
| | | if (!Directory.Exists(directoryPath))
|
| | | {
|
| | | return;
|
| | | continue;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | using vnxbqy.UI; |
| | | |
| | | public class WindowTool : EditorWindow |
| | | { |
| | |
| | | using UnityEditor; |
| | | using System; |
| | | |
| | | namespace vnxbqy.UI { |
| | | |
| | | [CustomEditor(typeof(CustomImage)), CanEditMultipleObjects] |
| | | public class CustomImageEidtor:Editor { |
| | | [CustomEditor(typeof(CustomImage)), CanEditMultipleObjects] |
| | | public class CustomImageEidtor:Editor { |
| | | |
| | | protected virtual void OnSceneGUI() { |
| | | var customImage = (CustomImage)this.target; |
| | | if(customImage.points != null) { |
| | | EditorGUI.BeginChangeCheck(); |
| | | for(var i = 0;i < customImage.points.Length;i++) { |
| | | var wh = customImage.points[i]; |
| | | var worldposition = customImage.transform.TransformPoint(wh); |
| | | var handlePosition = Handles.PositionHandle(worldposition,Quaternion.identity); |
| | | customImage.points[i] = customImage.transform.InverseTransformPoint(handlePosition); |
| | | } |
| | | |
| | | if(EditorGUI.EndChangeCheck()) { |
| | | customImage.SetVerticesDirty(); |
| | | } |
| | | |
| | | EditorUtility.SetDirty(customImage); |
| | | protected virtual void OnSceneGUI() { |
| | | var customImage = (CustomImage)this.target; |
| | | if(customImage.points != null) { |
| | | EditorGUI.BeginChangeCheck(); |
| | | for(var i = 0;i < customImage.points.Length;i++) { |
| | | var wh = customImage.points[i]; |
| | | var worldposition = customImage.transform.TransformPoint(wh); |
| | | var handlePosition = Handles.PositionHandle(worldposition,Quaternion.identity); |
| | | customImage.points[i] = customImage.transform.InverseTransformPoint(handlePosition); |
| | | } |
| | | |
| | | } |
| | | if(EditorGUI.EndChangeCheck()) { |
| | | customImage.SetVerticesDirty(); |
| | | } |
| | | |
| | | EditorUtility.SetDirty(customImage); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using UnityEditor; |
| | | namespace vnxbqy.UI |
| | | |
| | | [CustomEditor(typeof(FlipScroll))] |
| | | [CanEditMultipleObjects] |
| | | public class FlipScrollEditor : UnityEditor.UI.GraphicEditor |
| | | { |
| | | [CustomEditor(typeof(FlipScroll))] |
| | | [CanEditMultipleObjects] |
| | | public class FlipScrollEditor : UnityEditor.UI.GraphicEditor |
| | | private FlipScroll flipScroll; |
| | | |
| | | protected override void OnEnable() |
| | | { |
| | | private FlipScroll flipScroll; |
| | | |
| | | protected override void OnEnable() |
| | | { |
| | | base.OnEnable(); |
| | | if (target != null) { |
| | | flipScroll = target as FlipScroll; |
| | | } |
| | | base.OnEnable(); |
| | | if (target != null) { |
| | | flipScroll = target as FlipScroll; |
| | | } |
| | | |
| | | public override void OnInspectorGUI() |
| | | { |
| | | base.OnInspectorGUI(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.FlipType = (FlipScroll.FlipDirEnum)EditorGUILayout.EnumPopup("Flip Type", flipScroll.FlipType); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.tweenType = (FlipScroll.TweenType)EditorGUILayout.EnumPopup("Tween Type", flipScroll.tweenType); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.loop = EditorGUILayout.Toggle("Loop", flipScroll.loop); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.TweenTime = EditorGUILayout.FloatField("Duration", flipScroll.TweenTime); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | EditorGUILayout.LabelField("Present RT",GUILayout.Width(100)); |
| | | flipScroll.presentRT=EditorGUILayout.ObjectField(flipScroll.presentRT, typeof(RectTransform),true) as RectTransform; |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | EditorGUILayout.LabelField("Last RT", GUILayout.Width(100)); |
| | | flipScroll.lastRT = EditorGUILayout.ObjectField(flipScroll.lastRT, typeof(RectTransform),true) as RectTransform; |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.pageCnt = EditorGUILayout.IntField("Page Cnt",flipScroll.pageCnt); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.resetOnEnable = EditorGUILayout.Toggle("Reset OnEnable", flipScroll.resetOnEnable); |
| | | EditorGUILayout.EndHorizontal(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public override void OnInspectorGUI() |
| | | { |
| | | base.OnInspectorGUI(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.FlipType = (FlipScroll.FlipDirEnum)EditorGUILayout.EnumPopup("Flip Type", flipScroll.FlipType); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.tweenType = (FlipScroll.TweenType)EditorGUILayout.EnumPopup("Tween Type", flipScroll.tweenType); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.loop = EditorGUILayout.Toggle("Loop", flipScroll.loop); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.TweenTime = EditorGUILayout.FloatField("Duration", flipScroll.TweenTime); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | EditorGUILayout.LabelField("Present RT",GUILayout.Width(100)); |
| | | flipScroll.presentRT=EditorGUILayout.ObjectField(flipScroll.presentRT, typeof(RectTransform),true) as RectTransform; |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | EditorGUILayout.LabelField("Last RT", GUILayout.Width(100)); |
| | | flipScroll.lastRT = EditorGUILayout.ObjectField(flipScroll.lastRT, typeof(RectTransform),true) as RectTransform; |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.pageCnt = EditorGUILayout.IntField("Page Cnt",flipScroll.pageCnt); |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginHorizontal(); |
| | | flipScroll.resetOnEnable = EditorGUILayout.Toggle("Reset OnEnable", flipScroll.resetOnEnable); |
| | | EditorGUILayout.EndHorizontal(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | using UnityEngine.UI; |
| | | using UnityEngine; |
| | | |
| | | namespace vnxbqy.UI |
| | | [CustomEditor(typeof(FunctionButton), true), CanEditMultipleObjects] |
| | | public class FunctionButtonEditor : UnityEditor.UI.ButtonEditor |
| | | { |
| | | [CustomEditor(typeof(FunctionButton), true), CanEditMultipleObjects] |
| | | public class FunctionButtonEditor : UnityEditor.UI.ButtonEditor |
| | | |
| | | public override void OnInspectorGUI() |
| | | { |
| | | base.OnInspectorGUI(); |
| | | EditorGUILayout.Space(); |
| | | var instance = target as FunctionButton; |
| | | instance.order = EditorGUILayout.IntField("Order", instance.order); |
| | | instance.functionId = EditorGUILayout.IntField("FunctionId", instance.functionId); |
| | | instance.redpoint = (RedpointBehaviour)EditorGUILayout.ObjectField("Redpoint", instance.redpoint, typeof(RedpointBehaviour), true); |
| | | instance.state = (TitleBtnState)EditorGUILayout.EnumPopup("State", instance.state); |
| | | instance.button = (Button)EditorGUILayout.ObjectField("Button", instance.button, typeof(Button), true); |
| | | instance.icon = (ImageEx)EditorGUILayout.ObjectField("Image", instance.icon, typeof(ImageEx), true); |
| | | instance.title = (TextEx)EditorGUILayout.ObjectField("Title", instance.title, typeof(TextEx), true); |
| | | instance.shadow = (Shadow)EditorGUILayout.ObjectField("Shadow", instance.shadow, typeof(Shadow), true); |
| | | instance.locked = (Transform)EditorGUILayout.ObjectField("Locked", instance.locked, typeof(Transform), true); |
| | | instance.clickAudio = EditorGUILayout.IntField("Audio", instance.clickAudio); |
| | | |
| | | public override void OnInspectorGUI() |
| | | instance.useDefaultConfig = EditorGUILayout.Toggle("DefaultConfig", instance.useDefaultConfig); |
| | | if (!instance.useDefaultConfig) |
| | | { |
| | | base.OnInspectorGUI(); |
| | | EditorGUILayout.Space(); |
| | | var instance = target as FunctionButton; |
| | | instance.order = EditorGUILayout.IntField("Order", instance.order); |
| | | instance.functionId = EditorGUILayout.IntField("FunctionId", instance.functionId); |
| | | instance.redpoint = (RedpointBehaviour)EditorGUILayout.ObjectField("Redpoint", instance.redpoint, typeof(RedpointBehaviour), true); |
| | | instance.state = (TitleBtnState)EditorGUILayout.EnumPopup("State", instance.state); |
| | | instance.button = (Button)EditorGUILayout.ObjectField("Button", instance.button, typeof(Button), true); |
| | | instance.icon = (ImageEx)EditorGUILayout.ObjectField("Image", instance.icon, typeof(ImageEx), true); |
| | | instance.title = (TextEx)EditorGUILayout.ObjectField("Title", instance.title, typeof(TextEx), true); |
| | | instance.shadow = (Shadow)EditorGUILayout.ObjectField("Shadow", instance.shadow, typeof(Shadow), true); |
| | | instance.locked = (Transform)EditorGUILayout.ObjectField("Locked", instance.locked, typeof(Transform), true); |
| | | instance.clickAudio = EditorGUILayout.IntField("Audio", instance.clickAudio); |
| | | |
| | | instance.useDefaultConfig = EditorGUILayout.Toggle("DefaultConfig", instance.useDefaultConfig); |
| | | if (!instance.useDefaultConfig) |
| | | { |
| | | EditorGUI.indentLevel++; |
| | | instance.alternativeConfig = (FunctionButtonConfig)EditorGUILayout.ObjectField("备用配置", instance.alternativeConfig, typeof(FunctionButtonConfig), true); |
| | | EditorGUI.indentLevel--; |
| | | } |
| | | |
| | | instance.group = (FunctionButtonGroup)EditorGUILayout.ObjectField("Group", instance.group, typeof(FunctionButtonGroup), true); |
| | | EditorGUI.indentLevel++; |
| | | instance.alternativeConfig = (FunctionButtonConfig)EditorGUILayout.ObjectField("备用配置", instance.alternativeConfig, typeof(FunctionButtonConfig), true); |
| | | EditorGUI.indentLevel--; |
| | | } |
| | | } |
| | | |
| | | instance.group = (FunctionButtonGroup)EditorGUILayout.ObjectField("Group", instance.group, typeof(FunctionButtonGroup), true); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | using vnxbqy.UI; |
| | | using UnityEditor; |
| | | using UnityEditor; |
| | | |
| | | |
| | | [CustomEditor(typeof(LongPressButton), true), CanEditMultipleObjects] |
| | |
| | | using System.Collections; |
| | | using UnityEditor; |
| | | |
| | | namespace vnxbqy.UI { |
| | | |
| | | [CustomEditor(typeof(PolylineImage)), CanEditMultipleObjects] |
| | | public class PolylineImageEditor:Editor { |
| | | [CustomEditor(typeof(PolylineImage)), CanEditMultipleObjects] |
| | | public class PolylineImageEditor:Editor { |
| | | |
| | | protected virtual void OnSceneGUI() { |
| | | protected virtual void OnSceneGUI() { |
| | | |
| | | var polyline = (PolylineImage)this.target; |
| | | var polyline = (PolylineImage)this.target; |
| | | |
| | | if(polyline.points != null) { |
| | | EditorGUI.BeginChangeCheck(); |
| | | if(polyline.points != null) { |
| | | EditorGUI.BeginChangeCheck(); |
| | | |
| | | for(var i = 0;i < polyline.points.Length;i++) { |
| | | var wh = polyline.points[i]; |
| | | var worldposition = polyline.transform.TransformPoint(wh); |
| | | var handlePosition = Handles.PositionHandle(worldposition,Quaternion.identity); |
| | | polyline.points[i] = polyline.transform.InverseTransformPoint(handlePosition); |
| | | } |
| | | |
| | | if(EditorGUI.EndChangeCheck()) { |
| | | polyline.SetVerticesDirty(); |
| | | } |
| | | |
| | | EditorUtility.SetDirty(polyline); |
| | | for(var i = 0;i < polyline.points.Length;i++) { |
| | | var wh = polyline.points[i]; |
| | | var worldposition = polyline.transform.TransformPoint(wh); |
| | | var handlePosition = Handles.PositionHandle(worldposition,Quaternion.identity); |
| | | polyline.points[i] = polyline.transform.InverseTransformPoint(handlePosition); |
| | | } |
| | | |
| | | } |
| | | if(EditorGUI.EndChangeCheck()) { |
| | | polyline.SetVerticesDirty(); |
| | | } |
| | | |
| | | EditorUtility.SetDirty(polyline); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | //-------------------------------------------------------- |
| | | using UnityEditor; |
| | | |
| | | namespace vnxbqy.UI |
| | | |
| | | [CustomEditor(typeof(ToggleEx), true), CanEditMultipleObjects] |
| | | public class ToggleExEditor : UnityEditor.UI.ToggleEditor |
| | | { |
| | | |
| | | [CustomEditor(typeof(ToggleEx), true), CanEditMultipleObjects] |
| | | public class ToggleExEditor : UnityEditor.UI.ToggleEditor |
| | | public override void OnInspectorGUI() |
| | | { |
| | | public override void OnInspectorGUI() |
| | | { |
| | | base.OnInspectorGUI(); |
| | | base.OnInspectorGUI(); |
| | | |
| | | EditorGUILayout.Space(); |
| | | ToggleEx toggle = target as ToggleEx; |
| | | toggle.clickAudio = EditorGUILayout.IntField("音效", toggle.clickAudio); |
| | | } |
| | | |
| | | EditorGUILayout.Space(); |
| | | ToggleEx toggle = target as ToggleEx; |
| | | toggle.clickAudio = EditorGUILayout.IntField("音效", toggle.clickAudio); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | "standalone"; |
| | | #endif |
| | | |
| | | public const string windowFileBundleName = "ui/window"; |
| | | public const string uiprefabFileBundleName = "ui/prefab"; |
| | | public const string windowFileBundleName = "ui"; |
| | | public const string uiprefabFileBundleName = "prefab"; |
| | | |
| | | public readonly static string ResourcesOutPath = Application.dataPath + "/ResourcesOut/"; |
| | | public const string ResourcesOutAssetPath = "Assets/ResourcesOut/"; |
| | |
| | | #region 具体asset资源读取路径 |
| | | |
| | | public static readonly string MOB_FOLDER_NAME = "gmodels/"; |
| | | public static readonly string MOB_SUFFIX = "prefab_race_"; |
| | | |
| | | public static readonly string EFFECT_Folder_Name = "effect/"; |
| | | |
| | | public static readonly string UI_SPRITE_SUFFIX = "UI/Sprite"; |
| | | public static readonly string UI_WINDOW_SUFFIX = "UI/Window"; |
| | | public static readonly string UI_PRIORITYWINDOW_SUFFIX = "UI/PriorityWindow"; |
| | | public static readonly string UI_FONT_SUFFIX = "UI/Font"; |
| | | public static readonly string UI_PREFAB_SUFFIX = "UI/Prefab"; |
| | | public static readonly string UI_SPRITE_SUFFIX = "Sprite"; |
| | | public static readonly string UI_WINDOW_SUFFIX = "UI"; |
| | | public static readonly string UI_FONT_SUFFIX = "Font"; |
| | | public static readonly string UI_PREFAB_SUFFIX = "Prefab"; |
| | | |
| | | public static readonly string CONFIG_FODLER = ResourcesOutPath + "Config/"; |
| | | |
| | |
| | | |
| | | public class AssetSource |
| | | { |
| | | |
| | | public static bool allFromEditor |
| | | { |
| | | get |
| | | { |
| | | return audioFromEditor |
| | | && videoFromEditor |
| | | && effectFromEditor |
| | | && mobFromEditor |
| | | && refdataFromEditor |
| | | && sceneFromEditor |
| | | && shaderFromEditor |
| | | && uiFromEditor |
| | | && builtInFromEditor |
| | | && patchFromEditor |
| | | && logicFromEditor; |
| | | } |
| | | set |
| | | { |
| | | audioFromEditor = value; |
| | | videoFromEditor = value; |
| | | effectFromEditor = value; |
| | | mobFromEditor = value; |
| | | refdataFromEditor = value; |
| | | shaderFromEditor = value; |
| | | sceneFromEditor = value; |
| | | uiFromEditor = value; |
| | | builtInFromEditor = value; |
| | | patchFromEditor = value; |
| | | logicFromEditor = value; |
| | | } |
| | | } |
| | | |
| | | static bool m_AudioFromEditor = false; |
| | | public static bool audioFromEditor |
| | | public static bool isUseAssetBundle |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_AudioFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_AudioFromEditor", value); |
| | | #else |
| | | m_AudioFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_VideoFromEditor = false; |
| | | public static bool videoFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_VideoFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_VideoFromEditor", value); |
| | | #else |
| | | m_VideoFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_EffectFromEditor = false; |
| | | public static bool effectFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_EffectFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_EffectFromEditor", value); |
| | | #else |
| | | m_AudioFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_MobFromEditor = false; |
| | | public static bool mobFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_MobFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_MobFromEditor", value); |
| | | #else |
| | | m_MobFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_RefdataFromEditor = false; |
| | | public static bool refdataFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_RefdataFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_RefdataFromEditor", value); |
| | | #else |
| | | m_RefdataFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_SceneFromEditor = false; |
| | | public static bool sceneFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_SceneFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_SceneFromEditor", value); |
| | | #else |
| | | m_SceneFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_ShaderFromEditor = false; |
| | | public static bool shaderFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_ShaderFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_ShaderFromEditor", value); |
| | | #else |
| | | m_ShaderFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_UIFromEditor = false; |
| | | public static bool uiFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_UIFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_UIFromEditor", value); |
| | | #else |
| | | m_UIFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | static bool m_BuiltInFromEditor = false; |
| | | public static bool builtInFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_BuiltInFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_BuiltInFromEditor", value); |
| | | #else |
| | | m_BuiltInFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | |
| | | static bool m_patchFromEditor = false; |
| | | public static bool patchFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_PatchFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_PatchFromEditor", value); |
| | | #else |
| | | m_patchFromEditor=value; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | |
| | | static bool m_logicFromEditor = false; |
| | | public static bool logicFromEditor |
| | | { |
| | | get |
| | | { |
| | | #if UNITY_EDITOR |
| | | return LocalSave.GetBool("Asset_LogicFromEditor", true); |
| | | #else |
| | | return false; |
| | | #endif |
| | | } |
| | | set |
| | | { |
| | | #if UNITY_EDITOR |
| | | LocalSave.SetBool("Asset_LogicFromEditor", value); |
| | | #else |
| | | m_logicFromEditor=value; |
| | | return true; |
| | | #endif |
| | | } |
| | | } |
| | |
| | | m_AnchorMin: {x: 0.5, y: 0.5} |
| | | m_AnchorMax: {x: 0.5, y: 0.5} |
| | | m_AnchoredPosition: {x: 0, y: 0} |
| | | m_SizeDelta: {x: 1500, y: 2668} |
| | | m_SizeDelta: {x: 15000, y: 26680} |
| | | m_Pivot: {x: 0.5, y: 0.5} |
| | | --- !u!222 &4732318971056992194 |
| | | CanvasRenderer: |
| | |
| | | m_AnchorMin: {x: 0.5, y: 0.5} |
| | | m_AnchorMax: {x: 0.5, y: 0.5} |
| | | m_AnchoredPosition: {x: 0, y: 0} |
| | | m_SizeDelta: {x: 1500, y: 2668} |
| | | m_SizeDelta: {x: 15000, y: 26680} |
| | | m_Pivot: {x: 0.5, y: 0.5} |
| | | --- !u!222 &5139521211198942054 |
| | | CanvasRenderer: |