private void GetSelectedTemplates() { newTemplates = (from template in Selection.GetFiltered <TextAsset>(SelectionMode.Assets) where EZScriptProcessor.CheckTemplate(template.name + ".txt") == EZScriptProcessor.CheckResult.Template select template).ToArray(); Repaint(); }
private void GetUnityTemplates() { allTemplates = (from template in Directory.GetFiles(UnityScriptTemplatesDirPath, "*.txt", SearchOption.TopDirectoryOnly) where EZScriptProcessor.CheckTemplate(template) == EZScriptProcessor.CheckResult.Template select Path.GetFileName(template)) .OrderBy(fileName => int.Parse(fileName.Split('-')[0])) .ToArray(); }
protected void DrawPatternList() { EditorGUILayout.LabelField("Patterns", EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_TimeFormat); if (GUILayout.Button("Handle patterns in selected file")) { string filePath = AssetDatabase.GetAssetPath(Selection.activeObject); EZScriptProcessor.Replace(filePath); } EditorGUILayout.LabelField("00 #SCRIPTNAME#", "System.IO.Path.GetFileNameWithoutExtension(filePath)"); EditorGUILayout.LabelField("01 #CREATETIME#", "System.DateTime.Now.ToString()"); patternList.DoLayoutList(); extensionList.DoLayoutList(); }