您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
34 行
1.3 KiB
34 行
1.3 KiB
using UnityEngine;
|
|
using UnityEditor.Callbacks;
|
|
using UnityEditor.ProjectWindowCallback;
|
|
using System.IO;
|
|
|
|
namespace UnityEditor.VFXToolbox.ImageSequencer
|
|
{
|
|
internal class BuildTemplateAssetFactory
|
|
{
|
|
[MenuItem("Assets/Create/Build/Build Template", priority = BuildFrontend.CreateAssetMenuPriority)]
|
|
private static void MenuCreatePostProcessingProfile()
|
|
{
|
|
var icon = EditorGUIUtility.FindTexture("BuildTemplate");
|
|
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreateBuildTemplateAsset>(), "New BuildTemplate.asset", icon, null);
|
|
}
|
|
|
|
public static BuildTemplate CreateAssetAtPath(string path)
|
|
{
|
|
BuildTemplate asset = ScriptableObject.CreateInstance<BuildTemplate>();
|
|
asset.name = Path.GetFileName(path);
|
|
AssetDatabase.CreateAsset(asset, path);
|
|
return asset;
|
|
}
|
|
}
|
|
|
|
internal class DoCreateBuildTemplateAsset : EndNameEditAction
|
|
{
|
|
public override void Action(int instanceId, string pathName, string resourceFile)
|
|
{
|
|
BuildTemplate asset = BuildTemplateAssetFactory.CreateAssetAtPath(pathName);
|
|
ProjectWindowUtil.ShowCreatedAsset(asset);
|
|
}
|
|
}
|
|
}
|