Version: 2023.2

Provider.GetActiveConfigFields

切换到手册
public static ConfigField[] GetActiveConfigFields ();

描述

返回当前活动版本控制插件的配置字段。

The task can be useful if, for example, you need to change the version control plugin's credentials.

using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour { [MenuItem("Version Control/ConfigField")] public static void ExampleConfigField() { ConfigField[] exampleConfigField; exampleConfigField = Provider.GetActiveConfigFields(); EditorUserSettings.SetConfigValue(exampleConfigField[0].name, "username2"); Provider.UpdateSettings().Wait(); } }

The code above will fetch the currectly selected version control's config field names, change the first field to "username2" and update the version control settings.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961