Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

Assembly Constructor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Assembly(string name, string outputPath, string[] sourceFiles, string[] defines, Assembly[] assemblyReferences, string[] compiledAssemblyReferences, AssemblyFlags flags);

Parameters

Parameter Description
name The name of the assembly.
outputPath The full file path to write the compiled assembly to.
sourceFiles The paths of the script files to compile into the assembly.
defines The scripting symbols to define when compiling the assembly.
assemblyReferences The assemblies compiled by Unity that this assembly references.
compiledAssemblyReferences The file paths of precompiled assemblies that this assembly references.
flags Flags that describe the assembly, for example whether it's an Editor assembly. For more information, refer to AssemblyFlags.

Description

Creates an assembly with the default compiler options.

The assembly uses the default ScriptCompilerOptions and has an empty root namespace. To set either, use one of the other constructors.


Declaration

public Assembly(string name, string outputPath, string[] sourceFiles, string[] defines, Assembly[] assemblyReferences, string[] compiledAssemblyReferences, AssemblyFlags flags, ScriptCompilerOptions compilerOptions);

Parameters

Parameter Description
name The name of the assembly.
outputPath The full file path to write the compiled assembly to.
sourceFiles The paths of the script files to compile into the assembly.
defines The scripting symbols to define when compiling the assembly.
assemblyReferences The assemblies compiled by Unity that this assembly references.
compiledAssemblyReferences The file paths of precompiled assemblies that this assembly references.
flags Flags that describe the assembly, for example whether it's an Editor assembly. For more information, refer to AssemblyFlags.
compilerOptions The options to pass to the compiler, such as whether to allow unsafe code, the code optimization mode, and the API compatibility level. For more information, refer to ScriptCompilerOptions.

Description

Creates an assembly with the specified compiler options.

The assembly has an empty root namespace. To set a root namespace, use the constructor that takes rootNamespace.


Declaration

public Assembly(string name, string outputPath, string[] sourceFiles, string[] defines, Assembly[] assemblyReferences, string[] compiledAssemblyReferences, AssemblyFlags flags, ScriptCompilerOptions compilerOptions, string rootNamespace);

Parameters

Parameter Description
name The name of the assembly.
outputPath The full file path to write the compiled assembly to.
sourceFiles The paths of the script files to compile into the assembly.
defines The scripting symbols to define when compiling the assembly.
assemblyReferences The assemblies compiled by Unity that this assembly references.
compiledAssemblyReferences The file paths of precompiled assemblies that this assembly references.
flags Flags that describe the assembly, for example whether it's an Editor assembly. For more information, refer to AssemblyFlags.
compilerOptions The options to pass to the compiler, such as whether to allow unsafe code, the code optimization mode, and the API compatibility level. For more information, refer to ScriptCompilerOptions.
rootNamespace The root namespace that the scripts in the assembly belong to.

Description

Creates an assembly with the specified compiler options and root namespace.