示例#1
0
        private static void PostCompile()
        {
            EditorApplication.LockReloadAssemblies();
            try
            {
                var mainAssembly   = CecilUtility.GetAssembly("Assembly-CSharp").ToAssemblyDefinition();
                var editorAssembly = CecilUtility.GetAssembly("MCI").ToAssemblyDefinition();
                var engineAssembly = CecilUtility.EngineAssemblyDefinition();
                var modAssembly    = CreateAssembly();

                Process(mainAssembly, editorAssembly, engineAssembly, modAssembly);
            }
            finally
            {
                EditorApplication.UnlockReloadAssemblies();
            }
        }
示例#2
0
        private static void PostCompile()
        {
            EditorApplication.LockReloadAssemblies();
            try
            {
                var mainAssembly   = CecilUtility.GetAssembly("Assembly-CSharp");
                var editorAssembly = CecilUtility.GetAssembly("MCI");
                var engineAssembly = EngineAssemblyDefinition();

                Process(mainAssembly, editorAssembly, engineAssembly);
            }
            finally
            {
                EditorApplication.UnlockReloadAssemblies();
            }

            AssemblyDefinition EngineAssemblyDefinition()
            {
                const string path = "C:\\Program Files\\Unity\\Editor\\Data\\Managed\\UnityEngine.dll";

                return(AssemblyDefinition.ReadAssembly(path));
            }
        }