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

  1. using UnityEngine;
  2. using UnityEditor;
  3. using UnityEditor.ProjectWindowCallback;
  4. namespace AmplifyShaderEditor
  5. {
  6. //Callback on asset creation to open window after finishing renaming the asset
  7. public class DoCreateFunction : EndNameEditAction
  8. {
  9. public override void Action( int instanceId, string pathName, string resourceFile )
  10. {
  11. UnityEngine.Object obj = EditorUtility.InstanceIDToObject( instanceId );
  12. AssetDatabase.CreateAsset( obj, AssetDatabase.GenerateUniqueAssetPath( pathName ) );
  13. AmplifyShaderEditorWindow.LoadShaderFunctionToASE( (AmplifyShaderFunction)obj, false );
  14. }
  15. }
  16. }