I want to know how to execute a method when I create a new script, or rename an existing one ?
I know Unity do some processes when scripts are created. For example, when you create a script, the script is added to the list of components in the window Component > Scripts > NamespaceOfYourScript > NameOfYOurScript
. I want to do something like that, but for my own custom window. I'm pretty sure that the process is accessible, but I don't know its name, how to access it and use it.
I have already searched on the documentation, unity answers, stack overflow, but I don't find yet what I was looking for (without knowing what is the exact process keyword you are looking for, it's not helpful to the search).
I want to get a script a bit like this kind :
using UnityEngine;
using UnityEditor;
public class MyScript : SomeScriptProcess ()
{
void OnScriptSaved (System.Type TheScriptThatWasJustSaved)
{
//I execute my stuff here
}
}
Any help would be great. :)