コード例 #1
0
ファイル: AOTGenerator.cs プロジェクト: cleancoindev/ecs
        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);
        }
コード例 #2
0
ファイル: AOTGenerator.cs プロジェクト: cleancoindev/ecs
        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);
                }
            }
        }