public static void CompileAOT() { string path = null; var obj = Selection.activeObject; if (obj != null) { path = AssetDatabase.GetAssetPath(obj); if (System.IO.File.Exists(path) == true) { path = System.IO.Path.GetDirectoryName(path); } } if (string.IsNullOrEmpty(path) == true) { path = "Assets/"; } AOTGenerator.CompileDirectory(path); }
private static void OnAfterAssemblyReload(bool delete) { var asms = UnityEditor.AssetDatabase.FindAssets("t:asmdef"); foreach (var asm in asms) { var asmPath = UnityEditor.AssetDatabase.GUIDToAssetPath(asm); var asmNamePath = System.IO.Path.GetDirectoryName(asmPath); if (delete == true) { var fullDir = asmNamePath + "/aot.compiler.gen.cs"; if (System.IO.File.Exists(fullDir) == true) { AssetDatabase.DeleteAsset(fullDir); } } else { AOTGenerator.CompileDirectory(asmNamePath); } } }