Version: 2023.1

IInspectorWindowExtension.InvalidateVersionControlBarState

切换到手册
public void InvalidateVersionControlBarState ();

描述

Resets any cached state for the version control bar.

This method can be left empty if there's no cached state.

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; } }