I am trying to duplicate an animation controller each time a custom UI object is created. I can not figure out how to do this. I tried the code below but it fails everytime with an object not set to an instance of an object error. I would like it to be duplicated when the object is created not manually with ctrl+d.
if(AssetDatabase.CopyAsset(Resources/Animations/Transitions/Template/Frame.controller", "Resources/Animations/Transitions/Frame2.controller "))
{
Debug.Log("Copy Success");
}
else
{
Debug.Log("Copy Fail");
}
Hierarchy image Dropbox