You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 lines
600 B

using UnityEngine;
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
namespace AmplifyShaderEditor
{
//Callback on asset creation to open window after finishing renaming the asset
public class DoCreateFunction : EndNameEditAction
{
public override void Action( int instanceId, string pathName, string resourceFile )
{
UnityEngine.Object obj = EditorUtility.InstanceIDToObject( instanceId );
AssetDatabase.CreateAsset( obj, AssetDatabase.GenerateUniqueAssetPath( pathName ) );
AmplifyShaderEditorWindow.LoadShaderFunctionToASE( (AmplifyShaderFunction)obj, false );
}
}
}