using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace YKMoonEditor
{
public class ScriptTempleteUtility : Editor
{
///
/// Create script from template.
///
/// like "Assets/Editor/VelocityPresets/AUI.cs.txt"
/// like "NewUI.cs"
public static void CreateScriptAsset(string templatePath, string destName)
{
#if UNITY_2019_1_OR_NEWER
UnityEditor.ProjectWindowUtil.CreateScriptAssetFromTemplateFile(templatePath, destName);
#else
typeof(UnityEditor.ProjectWindowUtil)
.GetMethod("CreateScriptAsset", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)
.Invoke(null, new object[] { templatePath, destName });
#endif
}
}
}