public static int QueueCompileJob(string code, string[] assemblyPaths, bool sync = false) { CompileJob job = new CompileJob(NextJobId); compileJobs.Add(job); job.Start(code, assemblyPaths, sync); return(job.jobId); }
public static Type CreateScriptableType(string code, string[] assemblyPaths, string typeName = "GeneratedScriptable") { CompileJob job = new CompileJob(NextJobId); compileJobs.Add(job); job.Start(code, assemblyPaths, true); CompileJobStatus result; string dllPath; if (TryGetJobResult(job.jobId, out result, out dllPath)) { if (result == CompileJobStatus.Succeeded) { Assembly assembly = Assembly.LoadFrom(dllPath); try { File.Delete(dllPath); } catch { } return(assembly.GetType(typeName)); } } return(null); }
public static Type CreateScriptableType(string code, string[] assemblyPaths, string typeName = "GeneratedScriptable") { CompileJob job = new CompileJob(NextJobId); compileJobs.Add(job); job.Start(code, assemblyPaths, true); CompileJobStatus result; string dllPath; if (TryGetJobResult(job.jobId, out result, out dllPath)) { if (result == CompileJobStatus.Succeeded) { Assembly assembly = Assembly.LoadFrom(dllPath); try { File.Delete(dllPath); } catch { } return assembly.GetType(typeName); } } return null; }
public static int QueueCompileJob(string code, string[] assemblyPaths, bool sync = false) { CompileJob job = new CompileJob(NextJobId); compileJobs.Add(job); job.Start(code, assemblyPaths, sync); return job.jobId; }