editor | 包含版本控制栏的检查器。 |
允许您在指定的检查器中向版本控制栏添加自定义 GUI 控件。
using UnityEditor; using UnityEditor.VersionControl; using UnityEngine;
[VersionControl("Custom")] public class CustomVersionControlObject : VersionControlObject, IInspectorWindowExtension { string m_State;
public void OnVersionControlBar(Editor editor) { if (m_State == null) m_State = "Ready"; GUILayout.Label("State: " + m_State); }
public void InvalidateVersionControlBarState() { m_State = null; } }