public class UnityVersionManager
extends java.lang.Object
unity version manager tool.
It loads the needed dynamic library from the resource directory at startup time.| Constructor and Description |
|---|
UnityVersionManager() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
detectProjectVersion(java.io.File projectPath)
Detects the unity editor version used in
projectPath. |
static java.lang.String |
detectProjectVersion(java.io.File projectPath,
boolean withRevisionHash)
Detects the unity editor version used in
projectPath. |
static Installation |
installUnityEditor(java.lang.String version)
Installs the given version of unity to default destination.
|
static Installation |
installUnityEditor(java.lang.String version,
Component[] components)
Installs the given version of unity and additional components to default destination.
|
static Installation |
installUnityEditor(java.lang.String version,
java.io.File destination)
Installs the given version of unity to destination.
|
static Installation |
installUnityEditor(java.lang.String version,
java.io.File destination,
Component[] components)
Installs the given version of unity and additional components to destination.
|
static Component[] |
listAvailableComponents(java.lang.String version)
List all available components for the given unity version in the current platform.
|
static Installation[] |
listInstallations()
Lists Unity installations.
|
static Installation |
locateUnityInstallation(java.lang.String unityVersion)
Returns the path to the installation location for the provided version or
Null. |
static java.lang.String |
readUnityVersion(java.io.File installationLocation)
Return the version as
String of the unity installation at the provided location or Null. |
static java.lang.String |
uvmVersion()
Returns the uvm core library version.
|
public static java.lang.String uvmVersion()
public static Installation[] listInstallations()
Installation or nullpublic static java.lang.String detectProjectVersion(java.io.File projectPath)
projectPath.projectPath - the path to the unity project rootNULLpublic static java.lang.String detectProjectVersion(java.io.File projectPath,
boolean withRevisionHash)
projectPath.
The second Boolean parameter withRevision controls the format of the version string.
When set to true the returned version will be based on the m_EditorVersionWithRevision parameter
in the ProjectVersion.txt file. e.g. 2020.3.38f1 (8f5fde82e2dc)
Note: If the project is saved in an older format without the m_EditorVersionWithRevision parameter, then the m_EditorVersion parameter will be used which contains only the base version. Even if the m_EditorVersion is used the version could be returned with a release hash. But only if the version is known to uvm.
projectPath - the path to the unity project rootwithRevisionHash - return the version with the release revision hashNULLpublic static Installation locateUnityInstallation(java.lang.String unityVersion)
Null.unityVersion - the version string to fetch the installation location forInstallation object or nullpublic static Installation installUnityEditor(java.lang.String version, java.io.File destination)
If the unity version is already installed, returns early.
version - the version of unity to installdestination - the location to install unity toInstallation object or nullpublic static Installation installUnityEditor(java.lang.String version)
If the unity version is already installed, returns early.
version - the version of unity to installInstallation object or nullpublic static Installation installUnityEditor(java.lang.String version, Component[] components)
If the unity version and all requested components are already installed, returns early.
version - the version of unity to installcomponents - a list of optional Components to installInstallation object or nullComponent,
Installationpublic static Installation installUnityEditor(java.lang.String version, java.io.File destination, Component[] components)
If the unity version and all requested components are already installed, returns early.
version - the version of unity to installdestination - the location to install unity tocomponents - a list of optional Components to installInstallation object or nullComponent,
Installationpublic static Component[] listAvailableComponents(java.lang.String version)
version - the version of unity to list components fromComponents[] containing the requested componentspublic static java.lang.String readUnityVersion(java.io.File installationLocation)
String of the unity installation at the provided location or Null.installationLocation - the path to the unity installation or Unity executablenull