ScriptReference/AssetDatabase.CreateAsset #255
Replies: 2 comments
-
|
I forgot to add the filename to the end of CreateAsset and it just executes without throwing an error but also without creating a file. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
If you want to create text or script files with a template, you can use undocumented internal private static MethodInfo createScriptMethod = typeof(ProjectWindowUtil)
.GetMethod("CreateScriptAsset", BindingFlags.Static | BindingFlags.NonPublic);
static void CreateScriptAsset(string templatePath, string destName) {
createScriptMethod.Invoke(null, new object[] { templatePath, destName });
}for more details, see this forum thread. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/AssetDatabase.CreateAsset
https://docs.unity3d.com/ScriptReference/AssetDatabase.CreateAsset.html
Beta Was this translation helpful? Give feedback.
All reactions