using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; using UnityEditor.SceneManagement; namespace TFramework { public class TEditor : Editor { /// /// 控件标签标准宽度 /// protected virtual float LabelWidth=> EditorGUIUtility.labelWidth; /// /// 标记场景中值被改变 /// public void MarkerChange() { EditorUtility.SetDirty(target); if (EditorApplication.isPlaying) return; Component component = target as Component; if (component != null && component.gameObject.scene != null) { EditorSceneManager.MarkSceneDirty(component.gameObject.scene); } } public void DrawGUICopyButon(Rect rect,string v) { if (GUI.Button(rect,"复制")) { EditorGUIUtility.systemCopyBuffer = v; } } public void DrawGUILayoutCopyButton(string v) { if (GUILayout.Button("复制", GUILayout.ExpandWidth(false))) { EditorGUIUtility.systemCopyBuffer = v; } } } }