允许您向检查器中的版本控制设置添加自定义 GUI 控件。
using UnityEditor; using UnityEditor.VersionControl;
[VersionControl("Custom")] public class CustomVersionControlObject : VersionControlObject, ISettingsInspectorExtension { public void OnInspectorGUI() { var oldUsername = EditorUserSettings.GetConfigValue("vcCustomUsername"); var newUsername = EditorGUILayout.TextField("Username:", oldUsername); if (newUsername != oldUsername) EditorUserSettings.SetConfigValue("vcCustomUsername", newUsername); } }