public TempScriptHeader CreateCopy() { var copy = new TempScriptHeader(); copy.author = author; copy.time = this.time; copy.description = this.description; copy.scriptName = this.scriptName; copy.nameSpace = nameSpace; copy.detailInfo = new List <string>(detailInfo); return(copy); }
public virtual void OnFootGUI() { if (detailList == null) { InitDetailList(); } if (detailList.list != headerInfo.detailInfo) { detailList.list = headerInfo.detailInfo; } using (var horm = new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField("Namespace", GUILayout.Width(70)); headerInfo.nameSpace = EditorGUILayout.TextField(headerInfo.nameSpace, GUILayout.Width(60)); EditorGUILayout.LabelField("Type", GUILayout.Width(40)); headerInfo.scriptName = EditorGUILayout.TextField(headerInfo.scriptName, GUILayout.Width(60)); EditorGUILayout.LabelField("简介", GUILayout.Width(40)); headerInfo.description = EditorGUILayout.TextField(headerInfo.description); if (GUILayout.Button("Load", EditorStyles.miniButtonRight, GUILayout.Width(60))) { OnLoadButtonClicked(); } } using (var hor = new EditorGUILayout.HorizontalScope()) { using (var vertical = new EditorGUILayout.VerticalScope()) { detailList.DoLayoutList(); } using (var vertical = new EditorGUILayout.VerticalScope(GUILayout.Width(60))) { if (GUILayout.Button("Create", EditorStyles.miniButtonRight, GUILayout.Height(30))) { OnCreateButtonClicked(); } if (GUILayout.Button("Copy", EditorStyles.miniButtonRight, GUILayout.Height(15))) { common_headerInfo = headerInfo; } if (GUILayout.Button("Paste", EditorStyles.miniButtonRight, GUILayout.Height(15))) { headerInfo = common_headerInfo.CreateCopy(); } } } }