Description
The CodePackages
field is a collection of asset package names that the compiled code references. This field is part of the ExportConfig
class within the Editor
namespace. It is used to specify which asset packages are required by the assemblies during the export process.
Usage
To use the CodePackages
field, you can add or remove package names to the HashSet<string>
to manage the asset packages that your compiled code will reference. This is particularly useful when you need to ensure that all necessary packages are included during the export process.
Example
// Example of using the CodePackages field
// Create an instance of ExportConfig
ExportConfig exportConfig = new ExportConfig();
// Add a package to the CodePackages
exportConfig.CodePackages.Add("MyCustomPackage");
// Check if a package is referenced
if (exportConfig.CodePackages.Contains("MyCustomPackage"))
{
// Package is referenced
}
// Remove a package from the CodePackages
exportConfig.CodePackages.Remove("MyCustomPackage");