New file |
| | |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | using Snxxz.UI; |
| | | |
| | | [CustomEditor(typeof(Window), true)] |
| | | public class WindowEditor : Editor |
| | | { |
| | | private void OnEnable() |
| | | { |
| | | var safeArea = (target as Window).GetComponentInChildren<SafeAreaUI>(); |
| | | if (safeArea == null) |
| | | SceneView.lastActiveSceneView?.ShowNotification(new GUIContent("警告:当前窗口还没添加SafeAreaUI脚本"),5); |
| | | } |
| | | |
| | | public override void OnInspectorGUI() |
| | | { |
| | | base.OnInspectorGUI(); |
| | | } |
| | | } |
File was renamed from Assets/Editor/Tool/AssetSourceSettings.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0b2840c0a4ef9304fb735bd3ab3694bc |
| | | guid: 1b69e9a80ad58c040a6c10cb6a7fd0db |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
File was renamed from Assets/Editor/Tool/AssetSourceSettings.cs |
| | |
| | | |
| | | namespace Assets.Editor.Tool |
| | | { |
| | | public class AssetSourceSettings : EditorWindow |
| | | public class AssetSourceSetting : EditorWindow |
| | | { |
| | | |
| | | [MenuItem("Tools/资源加载方式")] |
| | | public static void ShowWindow() |
| | | { |
| | | EditorWindow.GetWindow<AssetSourceSettings>("资源加载方式").Show(); |
| | | EditorWindow.GetWindow<AssetSourceSetting>("资源加载方式").Show(); |
| | | } |
| | | |
| | | private void OnGUI() |
copy from Assets/Editor/Tool/AssetSourceSettings.cs.meta
copy to Assets/Editor/Tool/AssetSourceSetting.cs.meta
File was copied from Assets/Editor/Tool/AssetSourceSettings.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0b2840c0a4ef9304fb735bd3ab3694bc |
| | | guid: 855145b116838344ea3fb7b23439e3fc |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using UnityEditor; |
| | | |
| | | public class SafeAreaUISetting : EditorWindow |
| | | { |
| | | |
| | | [MenuItem("Tools/UI安全区适配")] |
| | | private static void ShowWindow() |
| | | { |
| | | var window = GetWindow<SafeAreaUISetting>(); |
| | | window.titleContent = new GUIContent("SafeAreaUISetting"); |
| | | window.Show(); |
| | | } |
| | | |
| | | private void OnGUI() |
| | | { |
| | | EditorGUILayout.Space(10); |
| | | SafeAreaUI.Sim = (SafeAreaUI.SimDevice)EditorGUILayout.EnumPopup("模拟设备", SafeAreaUI.Sim); |
| | | } |
| | | } |
copy from Assets/Editor/Tool/AssetSourceSettings.cs.meta
copy to Assets/Editor/Tool/SafeAreaUISetting.cs.meta
File was copied from Assets/Editor/Tool/AssetSourceSettings.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0b2840c0a4ef9304fb735bd3ab3694bc |
| | | guid: 593cdf5a332322745b8a578131b50d4e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |