GetProjects(ProjectTarget)
Gets the script projects Unity compiles, filtered by ProjectTarget.
Read time 1 minuteLast updated an hour ago
Definition
- Type: Method
- Namespace: UnityEditor.Compilation
- Assembly: UnityEditor.CoreModule
public static ProjectInfo[] GetProjects(ProjectTarget projectTarget)
Parameters
Which compilation to describe: the Editor, or the Player with or without test assemblies.
Returns
Type | Description |
|---|---|
| ProjectInfo[] | An array of the projects of that compilation. |
Remarks
Each ProjectInfo describes a project and the assembly it compiles to: its name, project file, output path, defines, source files and references.
When the MSBuild compilation pipeline is enabled, this method returns the projects of the last script compilation:
- Editor projects come from the last Editor script compilation.
- Player projects come from the last Player script compilation for the active build target. Before one exists, this method returns the Editor projects that aren't Editor-only, with the Editor's defines and references.
- Until scripts are compiled for the first time, for example while a new project opens, this method returns an empty array.
When the MSBuild compilation pipeline is disabled, this method describes the assemblies the legacy pipeline compiles, and projectFilePath is null.
Additional Resources: ProjectInfo, ProjectTarget.