SetVersionControl(string)
Sets the active version control system.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEditor.VersionControl
- Assembly: UnityEditor.CoreModule
public static bool SetVersionControl(string name)
Parameters
Unique version control system name.
Returns
Type | Description |
|---|---|
| bool | Returns true if VCS has been activated. false otherwise. |
Remarks
If a different VCS was previously active, it will be deactivated. You can use the VersionControlManager.versionControlDescriptors property to retrieve all the available version control systems. You can check the newly activated VersionControlObject by using the VersionControlManager.activeVersionControlObject property.
using UnityEditor;using UnityEditor.VersionControl;using UnityEngine;static class Example{ [MenuItem("Example/Set Custom VCS")] static void SetCustomVCS() { if (!VersionControlManager.SetVersionControl("Custom")) Debug.LogWarning("Failed to set custom VCS."); }}
Additional Resources: VersionControlManager, VersionControlObject, VersionControlDescriptor, Provider.