How do I go about adding a script component to any gameobject instanced in scene view .
i.e If i create a new Cube or a point light, a particular script will get attached to it .
I ave been looking at AssetPostprocessor but i did not find an answer there . the closest thing was using ModelImporter to get between the import process of models . but this will only work for models , models imported into unity.
For example when the following script is attached on GameObject1 in the scene, when it is clicked, it will first create a cube primitive in the scene, and then add a CustomMonobehaviour to it:
public class AddBehaviour : MonoBehaviour {
// Use this for initialization
void OnMouseDown() {
GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube)
cube.AddComponent<CustomMonoBehaviour>();
}
}