Description
The AddSourcePath
method is part of the Sandbox.Compiler
class. It allows you to add a new source path to the compiler's list of paths to include when building the assembly. This is useful for dynamically including additional source files located in different directories.
Usage
To use the AddSourcePath
method, you need to have an instance of the Sandbox.Compiler
class. Call the method with the full path of the directory containing the source files you want to include.
Example
// Create an instance of the Compiler
var compiler = new Compiler();
// Add a source path to the compiler
compiler.AddSourcePath("C:\\Projects\\MyGame\\Source");
// Proceed with other compiler operations, such as building the assembly
compiler.Build();