111
This commit is contained in:
21
Assets/ThirdParty/Tools/AmplifyShaderEditor/Plugins/Editor/DoCreateFunction.cs
vendored
Normal file
21
Assets/ThirdParty/Tools/AmplifyShaderEditor/Plugins/Editor/DoCreateFunction.cs
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Amplify Shader Editor - Visual Shader Editing Tool
|
||||
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEditor.ProjectWindowCallback;
|
||||
namespace AmplifyShaderEditor
|
||||
{
|
||||
public class DoCreateFunction : EndNameEditAction
|
||||
{
|
||||
public override void Action( int instanceId, string pathName, string resourceFile )
|
||||
{
|
||||
#if UNITY_6000_3_OR_NEWER
|
||||
UnityEngine.Object obj = EditorUtility.EntityIdToObject( instanceId );
|
||||
#else
|
||||
UnityEngine.Object obj = EditorUtility.InstanceIDToObject( instanceId );
|
||||
#endif
|
||||
AssetDatabase.CreateAsset( obj, AssetDatabase.GenerateUniqueAssetPath( pathName ) );
|
||||
AmplifyShaderEditorWindow.LoadShaderFunctionToASE( (AmplifyShaderFunction)obj, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user