Description
The AddAssembly
method is used to add a new assembly to the compile group. This method allows you to specify the name of the assembly, provide the assembly's byte data, and determine whether to raise an error if an assembly with the same name already exists.
Usage
To use the AddAssembly
method, you need to provide the following parameters:
name
: A string
representing the name of the assembly you want to add.
gameAssembly
: A Span<byte>
containing the byte data of the assembly.
complainIfExists
: A bool
indicating whether to throw an error if an assembly with the same name already exists in the compile group.
Call this method on an instance of CompileGroup
to add the assembly to that group.
Example
// Example of using AddAssembly
CompileGroup compileGroup = new CompileGroup();
string assemblyName = "MyGameAssembly";
byte[] assemblyData = File.ReadAllBytes("path/to/assembly.dll");
Span<byte> gameAssembly = new Span<byte>(assemblyData);
bool complainIfExists = true;
compileGroup.AddAssembly(assemblyName, gameAssembly, complainIfExists);