文档

Unity Engine

Unity Engine

SetVersionControl(string)

Sets the active version control system.
阅读时间1 分钟最后更新于 1 个月前

Definition

public static bool SetVersionControl(string name)

Parameters

name

Unique version control system name.

Returns

Type

Description

boolReturns 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."); }}