Skip to content

Commit

Permalink
Fix for Unity 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nowsprinting committed Oct 14, 2024
1 parent ecc317a commit ca2551a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Editor/DoCreateScriptFoldersWithTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ private static string AssemblyName(string moduleName, string firstLayerName, str

private static void CreateScriptAssetWithContent(string path, string content)
{
#if UNITY_6000_0
ProjectWindowUtil.CreateScriptAssetWithContent(path, content);
#else
var projectWindowUtilType = typeof(ProjectWindowUtil);
var createScriptAssetWithContentMethod = projectWindowUtilType.GetMethod("CreateScriptAssetWithContent",
BindingFlags.Static | BindingFlags.NonPublic);
Expand All @@ -128,6 +131,7 @@ private static void CreateScriptAssetWithContent(string path, string content)
}

createScriptAssetWithContentMethod.Invoke(null, new object[] { path, content });
#endif
}

private static bool IsUnderAssets(string pathName)
Expand Down

0 comments on commit ca2551a

Please sign in to comment.